Completed
Pull Request — master (#69)
by Greg
05:57
created
src/Formatters/StringFormatter.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -4,10 +4,7 @@
 block discarded – undo
4 4
 use Consolidation\OutputFormatters\Validate\ValidationInterface;
5 5
 use Consolidation\OutputFormatters\Options\OverrideOptionsInterface;
6 6
 use Consolidation\OutputFormatters\Options\FormatterOptions;
7
-use Consolidation\OutputFormatters\Validate\ValidDataTypesTrait;
8 7
 use Symfony\Component\Console\Output\OutputInterface;
9
-use Consolidation\OutputFormatters\StructuredData\RestructureInterface;
10
-use Consolidation\OutputFormatters\Transformations\SimplifiedFormatterInterface;
11 8
 use Consolidation\OutputFormatters\Transformations\SimplifyToStringInterface;
12 9
 
13 10
 /**
Please login to merge, or discard this patch.
src/StructuredData/UnstructuredListData.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         }
37 37
         $transformed_fields = [];
38 38
         foreach ($fields as $field) {
39
-            list($machine_name,$label) = explode(' as ', $field) + [$field, preg_replace('#.*\.#', '', $field)];
39
+            list($machine_name, $label) = explode(' as ', $field) + [$field, preg_replace('#.*\.#', '', $field)];
40 40
             $transformed_fields[$machine_name] = $label;
41 41
         }
42 42
         return $transformed_fields;
Please login to merge, or discard this patch.
src/FormatterManager.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
         if (count($validFormats) > 1) {
120 120
             // Make an input option for --format
121
-            $description = 'Format the result data. Available formats: ' . implode(',', $validFormats);
121
+            $description = 'Format the result data. Available formats: '.implode(',', $validFormats);
122 122
             $automaticOptions[FormatterOptions::FORMAT] = new InputOption(FormatterOptions::FORMAT, '', InputOption::VALUE_REQUIRED, $description, $defaultFormat);
123 123
         }
124 124
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
         if ($availableFields) {
128 128
             $defaultFields = $options->get(FormatterOptions::DEFAULT_FIELDS, [], '');
129
-            $description = 'Available fields: ' . implode(', ', $this->availableFieldsList($availableFields));
129
+            $description = 'Available fields: '.implode(', ', $this->availableFieldsList($availableFields));
130 130
             $automaticOptions[FormatterOptions::FIELDS] = new InputOption(FormatterOptions::FIELDS, '', InputOption::VALUE_REQUIRED, $description, $defaultFields);
131 131
         }
132 132
         elseif ($dataTypeClass->implementsInterface(RestructureInterface::class)) {
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
     protected function availableFieldsList($availableFields)
148 148
     {
149 149
         return array_map(
150
-            function ($key) use ($availableFields) {
151
-                return $availableFields[$key] . " ($key)";
150
+            function($key) use ($availableFields) {
151
+                return $availableFields[$key]." ($key)";
152 152
             },
153 153
             array_keys($availableFields)
154 154
         );
@@ -212,10 +212,10 @@  discard block
 block discarded – undo
212 212
      */
213 213
     public function write(OutputInterface $output, $format, $structuredOutput, FormatterOptions $options)
214 214
     {
215
-        $formatter = $this->getFormatter((string)$format);
215
+        $formatter = $this->getFormatter((string) $format);
216 216
         if (!is_string($structuredOutput) && !$this->isValidFormat($formatter, $structuredOutput)) {
217 217
             $validFormats = $this->validFormats($structuredOutput);
218
-            throw new InvalidFormatException((string)$format, $structuredOutput, $validFormats);
218
+            throw new InvalidFormatException((string) $format, $structuredOutput, $validFormats);
219 219
         }
220 220
         if ($structuredOutput instanceof FormatterAwareInterface) {
221 221
             $structuredOutput->setFormatter($formatter);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -128,8 +128,7 @@
 block discarded – undo
128 128
             $defaultFields = $options->get(FormatterOptions::DEFAULT_FIELDS, [], '');
129 129
             $description = 'Available fields: ' . implode(', ', $this->availableFieldsList($availableFields));
130 130
             $automaticOptions[FormatterOptions::FIELDS] = new InputOption(FormatterOptions::FIELDS, '', InputOption::VALUE_REQUIRED, $description, $defaultFields);
131
-        }
132
-        elseif ($dataTypeClass->implementsInterface(RestructureInterface::class)) {
131
+        } elseif ($dataTypeClass->implementsInterface(RestructureInterface::class)) {
133 132
             $automaticOptions[FormatterOptions::FIELDS] = new InputOption(FormatterOptions::FIELDS, '', InputOption::VALUE_REQUIRED, 'Dot notation of fields to include in output.', []);
134 133
         }
135 134
 
Please login to merge, or discard this patch.
src/Transformations/UnstructuredDataTransformation.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
     {
55 55
         $result = '';
56 56
         $iterator = $this->getIterator();
57
-        while($iterator->valid()) {
57
+        while ($iterator->valid()) {
58 58
             $simplifiedRow = $this->simplifyRow($iterator->current());
59 59
             if (isset($simplifiedRow)) {
60 60
                 $result .= "$simplifiedRow\n";
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
                     foreach ($item as $key => $value) {
42 42
                         $result->set($key, $value);
43 43
                     }
44
-                }
45
-                else {
44
+                } else {
46 45
                     $result->set($label, $data->get($key));
47 46
                 }
48 47
             }
Please login to merge, or discard this patch.