@@ -21,7 +21,7 @@ |
||
21 | 21 | * transformation object. First, though, remove any metadata items. |
22 | 22 | * |
23 | 23 | * @param FormatterOptions $options Options that affect output formatting. |
24 | - * @return Consolidation\OutputFormatters\Transformations\TableTransformation |
|
24 | + * @return \Consolidation\OutputFormatters\Transformations\TableTransformation |
|
25 | 25 | */ |
26 | 26 | public function restructure(FormatterOptions $options) |
27 | 27 | { |
@@ -59,6 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | /** |
61 | 61 | * Right-justify the cell data. |
62 | + * @param string $key |
|
62 | 63 | */ |
63 | 64 | protected function justifyCellData($key, $cellData) |
64 | 65 | { |
@@ -76,6 +77,7 @@ discard block |
||
76 | 77 | |
77 | 78 | /** |
78 | 79 | * Determine if this is a column that should be formatted. |
80 | + * @param string $key |
|
79 | 81 | */ |
80 | 82 | protected function isRenderedColumn($key) |
81 | 83 | { |
@@ -102,6 +104,7 @@ discard block |
||
102 | 104 | * This formatter only works with columns whose columns are strings. |
103 | 105 | * To use this formatter for another purpose, override this method |
104 | 106 | * to ensure that the cell data is a string before it is formatted. |
107 | + * @return double |
|
105 | 108 | */ |
106 | 109 | protected function convertCellDataToString($cellData) |
107 | 110 | { |
@@ -110,6 +113,7 @@ discard block |
||
110 | 113 | |
111 | 114 | /** |
112 | 115 | * Get the cached column width for the provided key. |
116 | + * @return integer |
|
113 | 117 | */ |
114 | 118 | protected function columnWidth($key) |
115 | 119 | { |
@@ -2,7 +2,6 @@ |
||
2 | 2 | namespace Consolidation\OutputFormatters\StructuredData; |
3 | 3 | |
4 | 4 | use Consolidation\OutputFormatters\Options\FormatterOptions; |
5 | - |
|
6 | 5 | use Consolidation\OutputFormatters\Formatters\FormatterAwareInterface; |
7 | 6 | use Consolidation\OutputFormatters\Formatters\FormatterAwareTrait; |
8 | 7 |
@@ -4,12 +4,10 @@ |
||
4 | 4 | use Symfony\Component\Console\Output\OutputInterface; |
5 | 5 | use Symfony\Component\Console\Helper\Table; |
6 | 6 | use Symfony\Component\Console\Helper\TableStyle; |
7 | - |
|
8 | 7 | use Consolidation\OutputFormatters\Validate\ValidDataTypesInterface; |
9 | 8 | use Consolidation\OutputFormatters\Options\FormatterOptions; |
10 | 9 | use Consolidation\OutputFormatters\Validate\ValidDataTypesTrait; |
11 | 10 | use Consolidation\OutputFormatters\StructuredData\TableDataInterface; |
12 | -use Consolidation\OutputFormatters\Transformations\ReorderFields; |
|
13 | 11 | use Consolidation\OutputFormatters\Exception\IncompatibleDataException; |
14 | 12 | use Consolidation\OutputFormatters\Transformations\WordWrapper; |
15 | 13 | use Consolidation\OutputFormatters\Formatters\HumanReadableFormat; |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | |
115 | 115 | if (count($validFormats) > 1) { |
116 | 116 | // Make an input option for --format |
117 | - $description = 'Format the result data. Available formats: ' . implode(',', $validFormats); |
|
117 | + $description = 'Format the result data. Available formats: '.implode(',', $validFormats); |
|
118 | 118 | $automaticOptions[FormatterOptions::FORMAT] = new InputOption(FormatterOptions::FORMAT, '', InputOption::VALUE_REQUIRED, $description, $defaultFormat); |
119 | 119 | } |
120 | 120 | |
121 | 121 | if ($availableFields) { |
122 | 122 | $defaultFields = $options->get(FormatterOptions::DEFAULT_FIELDS, [], ''); |
123 | - $description = 'Available fields: ' . implode(', ', $this->availableFieldsList($availableFields)); |
|
123 | + $description = 'Available fields: '.implode(', ', $this->availableFieldsList($availableFields)); |
|
124 | 124 | $automaticOptions[FormatterOptions::FIELDS] = new InputOption(FormatterOptions::FIELDS, '', InputOption::VALUE_REQUIRED, $description, $defaultFields); |
125 | 125 | $automaticOptions[FormatterOptions::FIELD] = new InputOption(FormatterOptions::FIELD, '', InputOption::VALUE_REQUIRED, "Select just one field, and force format to 'string'.", ''); |
126 | 126 | } |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | protected function availableFieldsList($availableFields) |
136 | 136 | { |
137 | 137 | return array_map( |
138 | - function ($key) use ($availableFields) { |
|
139 | - return $availableFields[$key] . " ($key)"; |
|
138 | + function($key) use ($availableFields) { |
|
139 | + return $availableFields[$key]." ($key)"; |
|
140 | 140 | }, |
141 | 141 | array_keys($availableFields) |
142 | 142 | ); |
@@ -200,10 +200,10 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function write(OutputInterface $output, $format, $structuredOutput, FormatterOptions $options) |
202 | 202 | { |
203 | - $formatter = $this->getFormatter((string)$format); |
|
203 | + $formatter = $this->getFormatter((string) $format); |
|
204 | 204 | if (!is_string($structuredOutput) && !$this->isValidFormat($formatter, $structuredOutput)) { |
205 | 205 | $validFormats = $this->validFormats($structuredOutput); |
206 | - throw new InvalidFormatException((string)$format, $structuredOutput, $validFormats); |
|
206 | + throw new InvalidFormatException((string) $format, $structuredOutput, $validFormats); |
|
207 | 207 | } |
208 | 208 | if ($structuredOutput instanceof FormatterAwareInterface) { |
209 | 209 | $structuredOutput->setFormatter($formatter); |