Completed
Pull Request — master (#5)
by
unknown
03:43
created
src/SimpleArrayLibrary.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -89,28 +89,28 @@  discard block
 block discarded – undo
89 89
                 if (isset($row[$column]) || array_key_exists($column, $row)) {
90 90
                     switch ($type) {
91 91
                         case self::TYPE_INT:
92
-                            $matrix[$key][$column] = (int)$row[$column];
92
+                            $matrix[$key][$column] = (int) $row[$column];
93 93
                             break;
94 94
                         case self::TYPE_STRING:
95
-                            $matrix[$key][$column] = (string)$row[$column];
95
+                            $matrix[$key][$column] = (string) $row[$column];
96 96
                             break;
97 97
                         case self::TYPE_FLOAT:
98
-                            $matrix[$key][$column] = (float)$row[$column];
98
+                            $matrix[$key][$column] = (float) $row[$column];
99 99
                             break;
100 100
                         case self::TYPE_BOOL:
101
-                            $matrix[$key][$column] = (bool)$row[$column];
101
+                            $matrix[$key][$column] = (bool) $row[$column];
102 102
                             break;
103 103
                         case self::TYPE_ARRAY:
104
-                            $matrix[$key][$column] = (array)$row[$column];
104
+                            $matrix[$key][$column] = (array) $row[$column];
105 105
                             break;
106 106
                         case self::TYPE_OBJECT:
107
-                            $matrix[$key][$column] = (object)$row[$column];
107
+                            $matrix[$key][$column] = (object) $row[$column];
108 108
                             break;
109 109
                         default:
110
-                            throw new UnexpectedValueException('Invalid type: ' . $type);
110
+                            throw new UnexpectedValueException('Invalid type: '.$type);
111 111
                     }
112 112
                 } elseif ($allKeysMustBePresent) {
113
-                    throw new UnexpectedValueException('Column: ' . $column . ' missing in row: ' . $key);
113
+                    throw new UnexpectedValueException('Column: '.$column.' missing in row: '.$key);
114 114
                 }
115 115
             }
116 116
         }
@@ -245,12 +245,12 @@  discard block
 block discarded – undo
245 245
         // validation
246 246
         foreach ($array as $key => $row) {
247 247
             if (!is_array($row)) {
248
-                throw new UnexpectedValueException('Array element "' . $key . '" is not an array');
248
+                throw new UnexpectedValueException('Array element "'.$key.'" is not an array');
249 249
             }
250 250
         }
251 251
         foreach ($columns as $key => $column) {
252 252
             if (!is_string($column) && !is_numeric($column)) {
253
-                throw new InvalidArgumentException('Invalid column type in columns array, index "' . $key . '"');
253
+                throw new InvalidArgumentException('Invalid column type in columns array, index "'.$key.'"');
254 254
             }
255 255
         }
256 256
         if (!is_bool($allRowsMustHaveAllColumns)) {
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
                 if (isset($row[$column]) || array_key_exists($column, $row)) {
264 264
                     $return[$column][$key] = $row[$column];
265 265
                 } elseif ($allRowsMustHaveAllColumns) {
266
-                    throw new UnexpectedValueException('Row "' . $key . '" is missing column: "' . $column . '"');
266
+                    throw new UnexpectedValueException('Row "'.$key.'" is missing column: "'.$column.'"');
267 267
                 }
268 268
             }
269 269
         }
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
      */
439 439
     public static function isAssociative(array $array)
440 440
     {
441
-        return (bool)count(array_filter(array_keys($array), 'is_string'));
441
+        return (bool) count(array_filter(array_keys($array), 'is_string'));
442 442
     }
443 443
 
444 444
     /**
Please login to merge, or discard this patch.