@@ -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) |
@@ -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 | |
@@ -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) { |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | if (is_scalar($values[$var]) || is_null($values[$var])) { |
| 237 | - return (string)$values[$var]; |
|
| 237 | + return (string) $values[$var]; |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | // otherwise we assume it is an array |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | |
| 243 | 243 | if (isset($arrayAccessor[0])) { |
| 244 | 244 | $from = $arrayAccessor[0] === '-' ? |
| 245 | - count($array) - abs($arrayAccessor) : (int)$arrayAccessor; |
|
| 245 | + count($array) - abs($arrayAccessor) : (int) $arrayAccessor; |
|
| 246 | 246 | |
| 247 | 247 | if ($from >= count($array)) { |
| 248 | 248 | return ''; |
@@ -32,10 +32,9 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function __construct($precision = null, $dateOnly = false) |
| 34 | 34 | { |
| 35 | - $this->precision = (int)$precision; |
|
| 35 | + $this->precision = (int) $precision; |
|
| 36 | 36 | $this->regex = $dateOnly ? |
| 37 | - '/^' . self::DATE_REGEX . '([ T]' . self::TIME_REGEX . self::ZONE_REGEX . ')?$/' : |
|
| 38 | - '/^' . self::DATE_REGEX . '[ T]' . self::TIME_REGEX . self::ZONE_REGEX . '$/'; |
|
| 37 | + '/^' . self::DATE_REGEX . '([ T]' . self::TIME_REGEX . self::ZONE_REGEX . ')?$/' : '/^' . self::DATE_REGEX . '[ T]' . self::TIME_REGEX . self::ZONE_REGEX . '$/'; |
|
| 39 | 38 | } |
| 40 | 39 | |
| 41 | 40 | public static function factory(Dbal $dbal, array $columnDefinition) |
@@ -60,7 +59,7 @@ discard block |
||
| 60 | 59 | 'NO_DATETIME', |
| 61 | 60 | '%value% is not a valid date or date time expression' |
| 62 | 61 | ); |
| 63 | - $error->addParams(['value' => (string)$value]); |
|
| 62 | + $error->addParams(['value' => (string) $value]); |
|
| 64 | 63 | |
| 65 | 64 | return $error; |
| 66 | 65 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | if (is_int($value)) { |
| 50 | - $value = (string)$value; |
|
| 50 | + $value = (string) $value; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | if (is_string($value) && |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | 'NOT_BOOLEAN', |
| 61 | 61 | '%value% can not be converted to boolean' |
| 62 | 62 | ); |
| 63 | - $error->addParams(['value' => (string)$value]); |
|
| 63 | + $error->addParams(['value' => (string) $value]); |
|
| 64 | 64 | |
| 65 | 65 | return $error; |
| 66 | 66 | } |