@@ -54,28 +54,28 @@ |
||
| 54 | 54 | if (isset($row[$column]) || array_key_exists($column, $row)) { |
| 55 | 55 | switch ($type) { |
| 56 | 56 | case self::TYPE_INT: |
| 57 | - $matrix[$key][$column] = (int)$row[$column]; |
|
| 57 | + $matrix[$key][$column] = (int) $row[$column]; |
|
| 58 | 58 | break; |
| 59 | 59 | case self::TYPE_STRING: |
| 60 | - $matrix[$key][$column] = (string)$row[$column]; |
|
| 60 | + $matrix[$key][$column] = (string) $row[$column]; |
|
| 61 | 61 | break; |
| 62 | 62 | case self::TYPE_FLOAT: |
| 63 | - $matrix[$key][$column] = (float)$row[$column]; |
|
| 63 | + $matrix[$key][$column] = (float) $row[$column]; |
|
| 64 | 64 | break; |
| 65 | 65 | case self::TYPE_BOOL: |
| 66 | - $matrix[$key][$column] = (bool)$row[$column]; |
|
| 66 | + $matrix[$key][$column] = (bool) $row[$column]; |
|
| 67 | 67 | break; |
| 68 | 68 | case self::TYPE_ARRAY: |
| 69 | - $matrix[$key][$column] = (array)$row[$column]; |
|
| 69 | + $matrix[$key][$column] = (array) $row[$column]; |
|
| 70 | 70 | break; |
| 71 | 71 | case self::TYPE_OBJECT: |
| 72 | - $matrix[$key][$column] = (object)$row[$column]; |
|
| 72 | + $matrix[$key][$column] = (object) $row[$column]; |
|
| 73 | 73 | break; |
| 74 | 74 | default: |
| 75 | - throw new UnexpectedValueException('Invalid type: ' . $type); |
|
| 75 | + throw new UnexpectedValueException('Invalid type: '.$type); |
|
| 76 | 76 | } |
| 77 | 77 | } elseif ($allKeysMustBePresent) { |
| 78 | - throw new UnexpectedValueException('Column: ' . $column . ' missing in row: ' . $key); |
|
| 78 | + throw new UnexpectedValueException('Column: '.$column.' missing in row: '.$key); |
|
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | } |
@@ -22,12 +22,12 @@ discard block |
||
| 22 | 22 | // validation |
| 23 | 23 | foreach ($array as $key => $row) { |
| 24 | 24 | if (!is_array($row)) { |
| 25 | - throw new UnexpectedValueException('Array element "' . $key . '" is not an array'); |
|
| 25 | + throw new UnexpectedValueException('Array element "'.$key.'" is not an array'); |
|
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | foreach ($columns as $key => $column) { |
| 29 | 29 | if (!is_string($column) && !is_numeric($column)) { |
| 30 | - throw new InvalidArgumentException('Invalid column type in columns array, index "' . $key . '"'); |
|
| 30 | + throw new InvalidArgumentException('Invalid column type in columns array, index "'.$key.'"'); |
|
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | if (!is_bool($allRowsMustHaveAllColumns)) { |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | if (isset($row[$column]) || array_key_exists($column, $row)) { |
| 41 | 41 | $return[$column][$key] = $row[$column]; |
| 42 | 42 | } elseif ($allRowsMustHaveAllColumns) { |
| 43 | - throw new UnexpectedValueException('Row "' . $key . '" is missing column: "' . $column . '"'); |
|
| 43 | + throw new UnexpectedValueException('Row "'.$key.'" is missing column: "'.$column.'"'); |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | public static function isAssociative(array $array) |
| 45 | 45 | { |
| 46 | - return (bool)count(array_filter(array_keys($array), 'is_string')); |
|
| 46 | + return (bool) count(array_filter(array_keys($array), 'is_string')); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -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; |