Fix CS/WS issues
This commit is contained in:
parent
84839970d0
commit
7ae5513327
|
|
@ -22,12 +22,6 @@ use SebastianBergmann\RecursionContext\Context;
|
|||
* $exporter = new Exporter;
|
||||
* print $exporter->export(new Exception);
|
||||
* </code>
|
||||
*
|
||||
* @package Exporter
|
||||
* @author Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* @copyright Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
|
||||
* @link https://github.com/sebastianbergmann/exporter
|
||||
*/
|
||||
class Exporter
|
||||
{
|
||||
|
|
@ -44,8 +38,8 @@ class Exporter
|
|||
* - Carriage returns and newlines are normalized to \n
|
||||
* - Recursion and repeated rendering is treated properly
|
||||
*
|
||||
* @param mixed $value
|
||||
* @param integer $indentation The indentation level of the 2nd+ line
|
||||
* @param mixed $value
|
||||
* @param int $indentation The indentation level of the 2nd+ line
|
||||
* @return string
|
||||
*/
|
||||
public function export($value, $indentation = 0)
|
||||
|
|
@ -60,8 +54,8 @@ class Exporter
|
|||
*/
|
||||
public function shortenedRecursiveExport(&$data, Context $context = null)
|
||||
{
|
||||
$result = array();
|
||||
$exporter = new Exporter();
|
||||
$result = array();
|
||||
$exporter = new self();
|
||||
|
||||
if (!$context) {
|
||||
$context = new Context;
|
||||
|
|
@ -88,7 +82,7 @@ class Exporter
|
|||
}
|
||||
}
|
||||
|
||||
return join(', ', $result);
|
||||
return implode(', ', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -101,7 +95,7 @@ class Exporter
|
|||
* Newlines are replaced by the visible string '\n'. Contents of arrays
|
||||
* and objects (if any) are replaced by '...'.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @param mixed $value
|
||||
* @return string
|
||||
* @see SebastianBergmann\Exporter\Exporter::export
|
||||
*/
|
||||
|
|
@ -145,12 +139,12 @@ class Exporter
|
|||
public function toArray($value)
|
||||
{
|
||||
if (!is_object($value)) {
|
||||
return (array)$value;
|
||||
return (array) $value;
|
||||
}
|
||||
|
||||
$array = array();
|
||||
|
||||
foreach ((array)$value as $key => $val) {
|
||||
foreach ((array) $value as $key => $val) {
|
||||
// properties are transformed to keys in the following way:
|
||||
// private $property => "\0Classname\0property"
|
||||
// protected $property => "\0*\0property"
|
||||
|
|
@ -197,9 +191,9 @@ class Exporter
|
|||
/**
|
||||
* Recursive implementation of export
|
||||
*
|
||||
* @param mixed $value The value to export
|
||||
* @param integer $indentation The indentation level of the 2nd+ line
|
||||
* @param \SebastianBergmann\RecursionContext\Context $processed Previously processed objects
|
||||
* @param mixed $value The value to export
|
||||
* @param int $indentation The indentation level of the 2nd+ line
|
||||
* @param \SebastianBergmann\RecursionContext\Context $processed Previously processed objects
|
||||
* @return string
|
||||
* @see SebastianBergmann\Exporter\Exporter::export
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue