@@ -42,7 +42,7 @@ |
||
42 | 42 | */ |
43 | 43 | public function write(OutputInterface $output, $format, $structuredOutput, FormatterOptions $options) |
44 | 44 | { |
45 | - $formatter = $this->getFormatter((string)$format); |
|
45 | + $formatter = $this->getFormatter((string) $format); |
|
46 | 46 | $structuredOutput = $this->validateAndRestructure($formatter, $structuredOutput, $options); |
47 | 47 | $formatter->write($output, $structuredOutput, $options); |
48 | 48 | } |
@@ -30,15 +30,15 @@ |
||
30 | 30 | if (is_array($data) || ($data->getName() == 'ArrayObject')) { |
31 | 31 | return 'an array'; |
32 | 32 | } |
33 | - return 'an instance of ' . $data->getName(); |
|
33 | + return 'an instance of '.$data->getName(); |
|
34 | 34 | } |
35 | 35 | if (is_string($data)) { |
36 | 36 | return 'a string'; |
37 | 37 | } |
38 | 38 | if (is_object($data)) { |
39 | - return 'an instance of ' . get_class($data); |
|
39 | + return 'an instance of '.get_class($data); |
|
40 | 40 | } |
41 | - throw new \Exception("Undescribable data error: " . var_export($data, true)); |
|
41 | + throw new \Exception("Undescribable data error: ".var_export($data, true)); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | protected static function describeAllowedTypes($allowedTypes) |
@@ -121,6 +121,10 @@ |
||
121 | 121 | return $this; |
122 | 122 | } |
123 | 123 | |
124 | + /** |
|
125 | + * @param string $key |
|
126 | + * @param boolean $value |
|
127 | + */ |
|
124 | 128 | public function setConfigurationDefault($key, $value) |
125 | 129 | { |
126 | 130 | if (!array_key_exists($key, $this->configurationData)) { |
@@ -4,7 +4,6 @@ |
||
4 | 4 | use Symfony\Component\Console\Input\InputInterface; |
5 | 5 | use Consolidation\OutputFormatters\Transformations\PropertyParser; |
6 | 6 | use Consolidation\OutputFormatters\StructuredData\Xml\XmlSchema; |
7 | -use Consolidation\OutputFormatters\StructuredData\Xml\XmlSchemaInterface; |
|
8 | 7 | |
9 | 8 | /** |
10 | 9 | * FormetterOptions holds information that affects the way a formatter |
@@ -19,7 +19,7 @@ |
||
19 | 19 | * transformation object. |
20 | 20 | * |
21 | 21 | * @param FormatterOptions $options Options that affect output formatting. |
22 | - * @return Consolidation\OutputFormatters\Transformations\TableTransformation |
|
22 | + * @return TableTransformation |
|
23 | 23 | */ |
24 | 24 | public function restructure(FormatterOptions $options) |
25 | 25 | { |
@@ -2,9 +2,6 @@ |
||
2 | 2 | namespace Consolidation\OutputFormatters\StructuredData; |
3 | 3 | |
4 | 4 | use Consolidation\OutputFormatters\FormatterOptions; |
5 | -use Consolidation\OutputFormatters\StructuredData\ListDataInterface; |
|
6 | -use Consolidation\OutputFormatters\Transformations\PropertyParser; |
|
7 | -use Consolidation\OutputFormatters\Transformations\ReorderFields; |
|
8 | 5 | use Consolidation\OutputFormatters\Transformations\TableTransformation; |
9 | 6 | |
10 | 7 | /** |
@@ -17,7 +17,7 @@ |
||
17 | 17 | * transformation object. |
18 | 18 | * |
19 | 19 | * @param FormatterOptions $options Options that affect output formatting. |
20 | - * @return Consolidation\OutputFormatters\Transformations\TableTransformation |
|
20 | + * @return \Consolidation\OutputFormatters\Transformations\TableTransformation |
|
21 | 21 | */ |
22 | 22 | public function restructure(FormatterOptions $options) |
23 | 23 | { |
@@ -34,6 +34,9 @@ |
||
34 | 34 | $this->addXmlChildren($dom, $element, $elementName, $structuredData); |
35 | 35 | } |
36 | 36 | |
37 | + /** |
|
38 | + * @param \DOMElement $xmlParent |
|
39 | + */ |
|
37 | 40 | protected function addXmlChildren(\DOMDocument $dom, $xmlParent, $elementName, $structuredData) |
38 | 41 | { |
39 | 42 | foreach ($structuredData as $key => $value) { |
@@ -4,7 +4,6 @@ |
||
4 | 4 | use Consolidation\OutputFormatters\SimplifyToArrayInterface; |
5 | 5 | use Consolidation\OutputFormatters\FormatterOptions; |
6 | 6 | use Consolidation\OutputFormatters\StructuredData\Xml\DomDataInterface; |
7 | -use Consolidation\OutputFormatters\StructuredData\Xml\XmlSchema; |
|
8 | 7 | |
9 | 8 | /** |
10 | 9 | * Simplify a DOMDocument to an array. |
@@ -25,7 +25,7 @@ |
||
25 | 25 | protected function tsvEscape($data) |
26 | 26 | { |
27 | 27 | return implode("\t", array_map( |
28 | - function ($item) { |
|
28 | + function($item) { |
|
29 | 29 | return str_replace(["\t", "\n"], ['\t', '\n'], $item); |
30 | 30 | }, |
31 | 31 | $data |