@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | 'time', |
163 | 163 | 'time_immutable', |
164 | 164 | ], true)) { |
165 | - if ($default !== null && in_array(strtoupper($default), ['CURRENT_TIMESTAMP' /* MySQL */, 'NOW()' /* PostgreSQL */, 'SYSDATE' /* Oracle */ , 'CURRENT_TIMESTAMP()' /* MariaDB 10.3 */], true)) { |
|
165 | + if ($default !== null && in_array(strtoupper($default), ['CURRENT_TIMESTAMP' /* MySQL */, 'NOW()' /* PostgreSQL */, 'SYSDATE' /* Oracle */, 'CURRENT_TIMESTAMP()' /* MariaDB 10.3 */], true)) { |
|
166 | 166 | $defaultCode = 'new \DateTimeImmutable()'; |
167 | 167 | } else { |
168 | 168 | throw new TDBMException('Unable to set default value for date in "'.$this->table->getName().'.'.$this->column->getName().'". Database passed this default value: "'.$default.'"'); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | case 'v4': |
187 | 187 | return 'Uuid::uuid4()->toString()'; |
188 | 188 | default: |
189 | - throw new TDBMException('@UUID annotation accepts either "v1" or "v4" parameter. Unexpected parameter: ' . $comment); |
|
189 | + throw new TDBMException('@UUID annotation accepts either "v1" or "v4" parameter. Unexpected parameter: '.$comment); |
|
190 | 190 | } |
191 | 191 | } |
192 | 192 | |
@@ -234,14 +234,14 @@ discard block |
||
234 | 234 | $resourceTypeCheck = sprintf($resourceTypeCheck, $checkNullable, $variableName, $variableName); |
235 | 235 | } |
236 | 236 | |
237 | - $types = [ $normalizedType ]; |
|
237 | + $types = [$normalizedType]; |
|
238 | 238 | if ($isNullable) { |
239 | 239 | $types[] = 'null'; |
240 | 240 | } |
241 | 241 | |
242 | 242 | $paramType = null; |
243 | 243 | if ($this->isTypeHintable()) { |
244 | - $paramType = ($isNullable?'?':'').$normalizedType; |
|
244 | + $paramType = ($isNullable ? '?' : '').$normalizedType; |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | $getter = new MethodGenerator($columnGetterName); |
@@ -337,11 +337,11 @@ discard block |
||
337 | 337 | break; |
338 | 338 | } |
339 | 339 | } |
340 | - $args = array_map(function ($v) { |
|
340 | + $args = array_map(function($v) { |
|
341 | 341 | return var_export($v, true); |
342 | 342 | }, $args); |
343 | - $args = empty($args) ? '' : ', ' . implode(', ', $args); |
|
344 | - $unit = $jsonFormat->unit ? ' . ' . var_export($jsonFormat->unit, true) : ''; |
|
343 | + $args = empty($args) ? '' : ', '.implode(', ', $args); |
|
344 | + $unit = $jsonFormat->unit ? ' . '.var_export($jsonFormat->unit, true) : ''; |
|
345 | 345 | if ($this->column->getNotnull()) { |
346 | 346 | return "\$array['$index'] = number_format(\$this->$getter()$args)$unit;"; |
347 | 347 | } else { |