Completed
Pull Request — master (#25)
by Greg
02:27
created
src/Formatters/TsvFormatter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Transformations/ReorderFields.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
         return
68 68
             array_filter(
69 69
                 array_keys($fieldLabels),
70
-                function ($key) use ($fieldRegex, $fieldLabels) {
70
+                function($key) use ($fieldRegex, $fieldLabels) {
71 71
                     $value = $fieldLabels[$key];
72 72
                     return preg_match($fieldRegex, $value) || preg_match($fieldRegex, $key);
73 73
                 }
Please login to merge, or discard this patch.
src/Exception/InvalidFormatException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     public function __construct($format, $data, $validFormats)
12 12
     {
13 13
         $dataDescription = static::describeDataType($data);
14
-        $message = "The format $format cannot be used with the data produced by this command, which was $dataDescription.  Valid formats are: " . implode(',', $validFormats);
14
+        $message = "The format $format cannot be used with the data produced by this command, which was $dataDescription.  Valid formats are: ".implode(',', $validFormats);
15 15
         parent::__construct($message, 1);
16 16
     }
17 17
 }
Please login to merge, or discard this patch.
src/Exception/AbstractDataFormatException.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,15 +30,15 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
src/FormatterManager.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
 
93 93
         if (count($validFormats) > 1) {
94 94
             // Make an input option for --format
95
-            $description = 'Format the result data. Available formats: ' . implode(',', $validFormats);
95
+            $description = 'Format the result data. Available formats: '.implode(',', $validFormats);
96 96
             $automaticOptions[FormatterOptions::FORMAT] = new InputOption(FormatterOptions::FORMAT, '', InputOption::VALUE_OPTIONAL, $description, $defaultFormat);
97 97
         }
98 98
 
99 99
         if ($availableFields) {
100 100
             $defaultFields = $options->get(FormatterOptions::DEFAULT_FIELDS, [], implode(',', $availableFields));
101
-            $description = 'Available fields: ' . implode(', ', $this->availableFieldsList($availableFields));
101
+            $description = 'Available fields: '.implode(', ', $this->availableFieldsList($availableFields));
102 102
             $automaticOptions[FormatterOptions::FIELDS] = new InputOption(FormatterOptions::FIELDS, '', InputOption::VALUE_OPTIONAL, $description, $defaultFields);
103 103
         }
104 104
 
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
     protected function availableFieldsList($availableFields)
113 113
     {
114 114
         return array_map(
115
-            function ($key) use ($availableFields) {
116
-                return $availableFields[$key] . " ($key)";
115
+            function($key) use ($availableFields) {
116
+                return $availableFields[$key]." ($key)";
117 117
             },
118 118
             array_keys($availableFields)
119 119
         );
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         }
197 197
         return array_reduce(
198 198
             $formatter->validDataTypes(),
199
-            function ($carry, $supportedType) use ($dataType) {
199
+            function($carry, $supportedType) use ($dataType) {
200 200
                 return
201 201
                     $carry ||
202 202
                     ($dataType->getName() == $supportedType->getName()) ||
@@ -216,10 +216,10 @@  discard block
 block discarded – undo
216 216
      */
217 217
     public function write(OutputInterface $output, $format, $structuredOutput, FormatterOptions $options)
218 218
     {
219
-        $formatter = $this->getFormatter((string)$format);
219
+        $formatter = $this->getFormatter((string) $format);
220 220
         if (!is_string($structuredOutput) && !$this->isValidFormat($formatter, $structuredOutput)) {
221 221
             $validFormats = $this->validFormats($structuredOutput);
222
-            throw new InvalidFormatException((string)$format, $structuredOutput, $validFormats);
222
+            throw new InvalidFormatException((string) $format, $structuredOutput, $validFormats);
223 223
         }
224 224
         // Give the formatter a chance to override the options
225 225
         $options = $this->overrideOptions($formatter, $structuredOutput, $options);
Please login to merge, or discard this patch.