@@ -297,7 +297,7 @@ |
||
| 297 | 297 | $this->columns = ['t0.*']; |
| 298 | 298 | $this->modifier = ['DISTINCT']; |
| 299 | 299 | |
| 300 | - return (int)$this->entityManager->getConnection()->query($query)->fetchColumn(); |
|
| 300 | + return (int) $this->entityManager->getConnection()->query($query)->fetchColumn(); |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | /** |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | $rawColumns = $result->fetchAll(\PDO::FETCH_ASSOC); |
| 58 | 58 | |
| 59 | 59 | if (count($rawColumns) === 0) { |
| 60 | - throw new Exception('Unknown table ' . $table); |
|
| 60 | + throw new Exception('Unknown table ' . $table); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $hasMultiplePrimaryKey = $this->hasMultiplePrimaryKey($rawColumns); |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function __construct($maxLength = null) |
| 27 | 27 | { |
| 28 | - $this->maxLength = (int)$maxLength; |
|
| 28 | + $this->maxLength = (int) $maxLength; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public static function factory(Dbal $dbal, array $columnDefinition) |
@@ -31,10 +31,9 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function __construct($precision = null, $dateOnly = false) |
| 33 | 33 | { |
| 34 | - $this->precision = (int)$precision; |
|
| 34 | + $this->precision = (int) $precision; |
|
| 35 | 35 | $this->regex = $dateOnly ? |
| 36 | - '/^' . self::DATE_REGEX . '([ T]' . self::TIME_REGEX . self::ZONE_REGEX . ')?$/' : |
|
| 37 | - '/^' . self::DATE_REGEX . '[ T]' . self::TIME_REGEX . self::ZONE_REGEX . '$/'; |
|
| 36 | + '/^' . self::DATE_REGEX . '([ T]' . self::TIME_REGEX . self::ZONE_REGEX . ')?$/' : '/^' . self::DATE_REGEX . '[ T]' . self::TIME_REGEX . self::ZONE_REGEX . '$/'; |
|
| 38 | 37 | } |
| 39 | 38 | |
| 40 | 39 | public static function factory(Dbal $dbal, array $columnDefinition) |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | if (is_int($value)) { |
| 49 | - $value = (string)$value; |
|
| 49 | + $value = (string) $value; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if (is_string($value) && ($value === $this->true || $value === $this->false)) { |
@@ -91,8 +91,7 @@ |
||
| 91 | 91 | |
| 92 | 92 | $definition['column_name'] = $rawColumn['Field']; |
| 93 | 93 | $definition['is_nullable'] = $rawColumn['Null'] === 'YES'; |
| 94 | - $definition['column_default'] = $rawColumn['Default'] !== null ? $rawColumn['Default'] : |
|
| 95 | - ($rawColumn['Extra'] === 'auto_increment' ? 'sequence(AUTO_INCREMENT)' : null); |
|
| 94 | + $definition['column_default'] = $rawColumn['Default'] !== null ? $rawColumn['Default'] : ($rawColumn['Extra'] === 'auto_increment' ? 'sequence(AUTO_INCREMENT)' : null); |
|
| 96 | 95 | $definition['character_maximum_length'] = null; |
| 97 | 96 | $definition['datetime_precision'] = null; |
| 98 | 97 | |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $this->message = $template->substitute( |
| 37 | 37 | $message ? $message : $this->message, |
| 38 | 38 | [ |
| 39 | - 'value' => (string)$value, |
|
| 39 | + 'value' => (string) $value, |
|
| 40 | 40 | 'column' => $column->name, |
| 41 | 41 | 'type' => get_class($column->type) |
| 42 | 42 | ] |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | $result = $this->entityManager->getConnection()->query($query->getQuery()); |
| 73 | 73 | $rawColumns = $result->fetchAll(PDO::FETCH_ASSOC); |
| 74 | 74 | if (count($rawColumns) === 0) { |
| 75 | - throw new Exception('Unknown table ' . $schemaTable); |
|
| 75 | + throw new Exception('Unknown table ' . $schemaTable); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | $cols = array_map(function ($columnDefinition) { |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | if (is_scalar($values[$var]) || is_null($values[$var])) { |
| 169 | - return (string)$values[$var]; |
|
| 169 | + return (string) $values[$var]; |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | // otherwise we assume it is an array |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | if (isset($arrayAccessor[0])) { |
| 176 | 176 | $from = $arrayAccessor[0] === '-' ? |
| 177 | - count($array) - abs($arrayAccessor) : (int)$arrayAccessor; |
|
| 177 | + count($array) - abs($arrayAccessor) : (int) $arrayAccessor; |
|
| 178 | 178 | |
| 179 | 179 | if ($from >= count($array)) { |
| 180 | 180 | return ''; |