@@ -133,7 +133,9 @@ |
||
| 133 | 133 | if (is_array($element)) { |
| 134 | 134 | $depth += self::countMaxDepth($element); |
| 135 | 135 | } |
| 136 | - if ($depth > $maxDepth) $maxDepth = $depth; |
|
| 136 | + if ($depth > $maxDepth) { |
|
| 137 | + $maxDepth = $depth; |
|
| 138 | + } |
|
| 137 | 139 | } |
| 138 | 140 | |
| 139 | 141 | return $maxDepth; |
@@ -89,28 +89,28 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | /** |