@@ -194,25 +194,25 @@ |
||
194 | 194 | $value = $repository->extractOne($entity, $attribute); |
195 | 195 | |
196 | 196 | if ($isUninitialized) { |
197 | - $this->fail($message . ': Expected attribute "'.$path.'" to be not initialised'); |
|
197 | + $this->fail($message.': Expected attribute "'.$path.'" to be not initialised'); |
|
198 | 198 | } |
199 | 199 | } catch (UninitializedPropertyException $e) { |
200 | 200 | if (!$isUninitialized) { |
201 | - $this->fail($message . ': The attribute "'.$path.'" is not initialised'); |
|
201 | + $this->fail($message.': The attribute "'.$path.'" is not initialised'); |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | |
205 | 205 | if (!is_object($expectedValue)) { |
206 | - $this->assertSame($expectedValue, $value, $message . ': Expected attribute "'.$path.'" is not the same'); |
|
206 | + $this->assertSame($expectedValue, $value, $message.': Expected attribute "'.$path.'" is not the same'); |
|
207 | 207 | continue; |
208 | 208 | } |
209 | 209 | |
210 | 210 | if ($expectedValue instanceof Constraint) { |
211 | - $this->assertThat($value, $expectedValue, $message . ': Expected attribute "'.$path.'" is not the same'); |
|
211 | + $this->assertThat($value, $expectedValue, $message.': Expected attribute "'.$path.'" is not the same'); |
|
212 | 212 | } elseif ($expectedValue instanceof \DateTimeInterface) { |
213 | - $this->assertEqualsWithDelta($expectedValue, $value, $dateTimeDelta, $message . ': Expected attribute "'.$path.'" is not the same'); |
|
213 | + $this->assertEqualsWithDelta($expectedValue, $value, $dateTimeDelta, $message.': Expected attribute "'.$path.'" is not the same'); |
|
214 | 214 | } else { |
215 | - $this->assertEquals($expectedValue, $value, $message . ': Expected attribute "'.$path.'" is not the same'); |
|
215 | + $this->assertEquals($expectedValue, $value, $message.': Expected attribute "'.$path.'" is not the same'); |
|
216 | 216 | } |
217 | 217 | } |
218 | 218 | } |
@@ -15,6 +15,6 @@ |
||
15 | 15 | */ |
16 | 16 | public function __construct(string $entity, string $field) |
17 | 17 | { |
18 | - parent::__construct('The field "' . $field . '" is not declared for the entity ' . $entity); |
|
18 | + parent::__construct('The field "'.$field.'" is not declared for the entity '.$entity); |
|
19 | 19 | } |
20 | 20 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | public function __construct(string $entityClass, string $message = '', ?Throwable $previous = null) |
26 | 26 | { |
27 | - parent::__construct($entityClass . ' : ' . $message, 0, $previous); |
|
27 | + parent::__construct($entityClass.' : '.$message, 0, $previous); |
|
28 | 28 | |
29 | 29 | $this->entityClass = $entityClass; |
30 | 30 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | - throw new HydratorGenerationException($this->className, 'Cannot get the value of property "' . $attribute . '"'); |
|
92 | + throw new HydratorGenerationException($this->className, 'Cannot get the value of property "'.$attribute.'"'); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | return $varName.'->set'.ucfirst($attribute).'('.$value.')'; |
119 | 119 | } |
120 | 120 | |
121 | - throw new HydratorGenerationException($this->className, 'Cannot access to attribute "' . $attribute . '" on write'); |
|
121 | + throw new HydratorGenerationException($this->className, 'Cannot access to attribute "'.$attribute.'" on write'); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | } |
165 | 165 | } |
166 | 166 | } catch (ReflectionException $e) { |
167 | - throw new HydratorGenerationException($this->className, 'Cannot access to the property ' . $prop, $e); |
|
167 | + throw new HydratorGenerationException($this->className, 'Cannot access to the property '.$prop, $e); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | return true; |
@@ -327,7 +327,7 @@ |
||
327 | 327 | return array_unique($classes); |
328 | 328 | |
329 | 329 | default: |
330 | - throw new HydratorGenerationException($this->mapper->getEntityClass(), 'Cannot handle relation type ' . $relation['type']); |
|
330 | + throw new HydratorGenerationException($this->mapper->getEntityClass(), 'Cannot handle relation type '.$relation['type']); |
|
331 | 331 | } |
332 | 332 | } |
333 | 333 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $values = []; |
47 | 47 | $attributes = array_flip($attributes); |
48 | 48 | |
49 | - $privatePrefix = "\0" . get_class($object) . "\0"; |
|
49 | + $privatePrefix = "\0".get_class($object)."\0"; |
|
50 | 50 | $privatePrefixLen = strlen($privatePrefix); |
51 | 51 | |
52 | 52 | foreach ((array) $object as $name => $property) { |
@@ -83,13 +83,13 @@ discard block |
||
83 | 83 | return $this->hydratorsCache[$entityClass]; |
84 | 84 | } |
85 | 85 | |
86 | - $hydrator = static function ($object, array $data) { |
|
86 | + $hydrator = static function($object, array $data) { |
|
87 | 87 | foreach ($data as $property => $value) { |
88 | 88 | try { |
89 | 89 | if (isset($object->$property) && $object->$property instanceof ImportableInterface && is_array($value)) { |
90 | 90 | $object->$property->import($value); |
91 | - } elseif (method_exists($object, 'set' . ucfirst($property))) { |
|
92 | - $object->{'set' . ucfirst($property)}($value); |
|
91 | + } elseif (method_exists($object, 'set'.ucfirst($property))) { |
|
92 | + $object->{'set'.ucfirst($property)}($value); |
|
93 | 93 | } elseif (property_exists($object, $property)) { |
94 | 94 | $object->$property = $value; |
95 | 95 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function hydratorClassName() |
127 | 127 | { |
128 | - return 'Hydrator_' . str_replace('\\', '_', $this->className); |
|
128 | + return 'Hydrator_'.str_replace('\\', '_', $this->className); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function hydratorFullClassName() |
137 | 137 | { |
138 | - return $this->hydratorNamespace() . '\\' . $this->hydratorClassName(); |
|
138 | + return $this->hydratorNamespace().'\\'.$this->hydratorClassName(); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | if (!isset($classes[$class])) { |
168 | 168 | $classes[$class] = true; |
169 | 169 | |
170 | - $property = '__' . str_replace('\\', '_', $class) . '_hydrator'; |
|
170 | + $property = '__'.str_replace('\\', '_', $class).'_hydrator'; |
|
171 | 171 | $this->embeddedHydrators[$class] = $property; |
172 | 172 | } |
173 | 173 | } |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | protected function generateEmbeddedHydrate(AttributeInfo $attribute) |
274 | 274 | { |
275 | 275 | // We can have multiple entity classes for one attribute : morph |
276 | - $varName = '$__rel_' . str_replace('.', '_', $attribute->name()); |
|
276 | + $varName = '$__rel_'.str_replace('.', '_', $attribute->name()); |
|
277 | 277 | |
278 | 278 | $hydrators = []; |
279 | 279 | |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | return '$this'; |
309 | 309 | } |
310 | 310 | |
311 | - return '$this->' . $this->embeddedHydrators[$class]; |
|
311 | + return '$this->'.$this->embeddedHydrators[$class]; |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | /** |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | */ |
321 | 321 | protected function normalizeClassName($className) |
322 | 322 | { |
323 | - return '\\' . ltrim($className, '\\'); |
|
323 | + return '\\'.ltrim($className, '\\'); |
|
324 | 324 | } |
325 | 325 | |
326 | 326 | /** |
@@ -373,11 +373,11 @@ discard block |
||
373 | 373 | } |
374 | 374 | |
375 | 375 | if (empty($possiblyNotInitialized)) { |
376 | - return 'return [' . implode(', ', $lines) . '];'; |
|
376 | + return 'return ['.implode(', ', $lines).'];'; |
|
377 | 377 | } |
378 | 378 | |
379 | - return '$values = [' . implode(', ', $lines) . '];' . PHP_EOL . PHP_EOL . |
|
380 | - implode(PHP_EOL, $possiblyNotInitialized) . PHP_EOL . PHP_EOL . |
|
379 | + return '$values = ['.implode(', ', $lines).'];'.PHP_EOL.PHP_EOL. |
|
380 | + implode(PHP_EOL, $possiblyNotInitialized).PHP_EOL.PHP_EOL. |
|
381 | 381 | 'return $values;' |
382 | 382 | ; |
383 | 383 | } |
@@ -439,8 +439,8 @@ discard block |
||
439 | 439 | $line = ''; |
440 | 440 | |
441 | 441 | if ($attribute->isEmbedded()) { |
442 | - $varName = '$__rel_' . str_replace('.', '_', $attribute->name()); |
|
443 | - $line .= '(' . $varName . ' = '.$this->accessor->getter('$object', $attribute->property()) . ") === null ? null : "; |
|
442 | + $varName = '$__rel_'.str_replace('.', '_', $attribute->name()); |
|
443 | + $line .= '('.$varName.' = '.$this->accessor->getter('$object', $attribute->property()).") === null ? null : "; |
|
444 | 444 | |
445 | 445 | foreach ($attribute->embedded()->classes() as $class) { |
446 | 446 | if ($this->resolver->isImportable($class)) { |
@@ -733,13 +733,13 @@ discard block |
||
733 | 733 | */ |
734 | 734 | protected function generateExtractOneCaseEmbedded(EmbeddedInfo $embedded) |
735 | 735 | { |
736 | - $varName = '$__' . str_replace('.', '_', $embedded->path()); |
|
736 | + $varName = '$__'.str_replace('.', '_', $embedded->path()); |
|
737 | 737 | $code = $this->accessors->embedded($embedded)->getEmbedded($varName, false); |
738 | 738 | $className = $embedded->isRoot() ? $this->mapper->getEntityClass() : $embedded->parent()->class(); |
739 | 739 | |
740 | 740 | return <<<PHP |
741 | 741 | try { |
742 | -{$this->code->indent($this->code->lines([$code, 'return ' . $varName . ';']), 1)} |
|
742 | +{$this->code->indent($this->code->lines([$code, 'return '.$varName.';']), 1)} |
|
743 | 743 | } catch (\Error \$e) { |
744 | 744 | throw new \Bdf\Prime\Entity\Hydrator\Exception\UninitializedPropertyException('{$className}', '{$embedded->property()}'); |
745 | 745 | } |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | ->fullSetter($attribute->property(), '$value', '$__embedded').';' |
795 | 795 | ; |
796 | 796 | } else { |
797 | - $code = $this->accessor->setter('$object', $attribute->property(), '$value', false) . ';'; |
|
797 | + $code = $this->accessor->setter('$object', $attribute->property(), '$value', false).';'; |
|
798 | 798 | } |
799 | 799 | |
800 | 800 | // Always surround with try catch because setter can also be typed |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | $body = str_replace('<spaces>', $this->spaces, $body); |
387 | 387 | $last = strrpos($currentCode, '}'); |
388 | 388 | |
389 | - return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : '') . "}\n"; |
|
389 | + return substr($currentCode, 0, $last).$body.(strlen($body) > 0 ? "\n" : '')."}\n"; |
|
390 | 390 | } |
391 | 391 | |
392 | 392 | /** |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | protected function generateEntityNamespace(): string |
396 | 396 | { |
397 | 397 | if ($this->hasNamespace($this->mapperInfo->className())) { |
398 | - return 'namespace ' . $this->getNamespace($this->mapperInfo->className()) .';' . "\n\n"; |
|
398 | + return 'namespace '.$this->getNamespace($this->mapperInfo->className()).';'."\n\n"; |
|
399 | 399 | } |
400 | 400 | |
401 | 401 | return ''; |
@@ -411,18 +411,18 @@ discard block |
||
411 | 411 | $use = []; |
412 | 412 | |
413 | 413 | if ($this->hasNamespace($this->getClassToExtend())) { |
414 | - $use[$this->getClassToExtend()] = 'use ' . $this->getClassToExtend() . ';'; |
|
414 | + $use[$this->getClassToExtend()] = 'use '.$this->getClassToExtend().';'; |
|
415 | 415 | } |
416 | 416 | |
417 | 417 | foreach ($this->interfaces as $interface) { |
418 | 418 | if ($this->hasNamespace($interface)) { |
419 | - $use[$interface] = 'use ' . $interface . ';'; |
|
419 | + $use[$interface] = 'use '.$interface.';'; |
|
420 | 420 | } |
421 | 421 | } |
422 | 422 | |
423 | 423 | foreach ($this->traits as $trait) { |
424 | 424 | if ($this->hasNamespace($trait)) { |
425 | - $use[$trait] = 'use ' . $trait . ';'; |
|
425 | + $use[$trait] = 'use '.$trait.';'; |
|
426 | 426 | } |
427 | 427 | } |
428 | 428 | |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | |
453 | 453 | sort($use); |
454 | 454 | |
455 | - return implode("\n", $use) . "\n\n"; |
|
455 | + return implode("\n", $use)."\n\n"; |
|
456 | 456 | } |
457 | 457 | |
458 | 458 | /** |
@@ -460,9 +460,9 @@ discard block |
||
460 | 460 | */ |
461 | 461 | protected function generateEntityClassName() |
462 | 462 | { |
463 | - return 'class ' . $this->getClassName($this->mapperInfo->className()) . |
|
464 | - ($this->classToExtend ? ' extends ' . $this->getClassToExtendName() : null) . |
|
465 | - ($this->interfaces ? ' implements ' . $this->getInterfacesToImplement() : null); |
|
463 | + return 'class '.$this->getClassName($this->mapperInfo->className()). |
|
464 | + ($this->classToExtend ? ' extends '.$this->getClassToExtendName() : null). |
|
465 | + ($this->interfaces ? ' implements '.$this->getInterfacesToImplement() : null); |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | /** |
@@ -477,10 +477,10 @@ discard block |
||
477 | 477 | $traits = ''; |
478 | 478 | |
479 | 479 | foreach ($this->traits as $trait) { |
480 | - $traits .= $this->spaces . 'use ' . $this->getRelativeClassName($trait) . ';' . "\n"; |
|
480 | + $traits .= $this->spaces.'use '.$this->getRelativeClassName($trait).';'."\n"; |
|
481 | 481 | } |
482 | 482 | |
483 | - return $traits . "\n"; |
|
483 | + return $traits."\n"; |
|
484 | 484 | } |
485 | 485 | |
486 | 486 | /** |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | { |
586 | 586 | $lines = array(); |
587 | 587 | $lines[] = '/**'; |
588 | - $lines[] = ' * ' . $this->getClassName($this->mapperInfo->className()); |
|
588 | + $lines[] = ' * '.$this->getClassName($this->mapperInfo->className()); |
|
589 | 589 | $lines[] = ' */'; |
590 | 590 | |
591 | 591 | return implode("\n", $lines); |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | |
686 | 686 | if (!$property->isRelation()) { |
687 | 687 | $lines[] = $this->generateEmbeddedPropertyDocBlock($property); |
688 | - $lines[] = $this->spaces . $this->fieldVisibility . $this->getPropertyTypeHintForObject($property) . ' $'.$property->name().";\n"; |
|
688 | + $lines[] = $this->spaces.$this->fieldVisibility.$this->getPropertyTypeHintForObject($property).' $'.$property->name().";\n"; |
|
689 | 689 | } else { |
690 | 690 | $name = $property->name(); |
691 | 691 | $default = ''; |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | } |
702 | 702 | |
703 | 703 | $lines[] = $this->generateEmbeddedPropertyDocBlock($property); |
704 | - $lines[] = $this->spaces . $this->fieldVisibility . $this->getPropertyTypeHintForObject($property) . ' $' . $name . $default .";\n"; |
|
704 | + $lines[] = $this->spaces.$this->fieldVisibility.$this->getPropertyTypeHintForObject($property).' $'.$name.$default.";\n"; |
|
705 | 705 | } |
706 | 706 | } |
707 | 707 | |
@@ -729,7 +729,7 @@ discard block |
||
729 | 729 | $variableName = $this->inflector->camelize($fieldName); |
730 | 730 | $methodName = $variableName; |
731 | 731 | } else { |
732 | - $methodName = $type . $this->inflector->classify($fieldName); |
|
732 | + $methodName = $type.$this->inflector->classify($fieldName); |
|
733 | 733 | $variableName = $this->inflector->camelize($fieldName); |
734 | 734 | } |
735 | 735 | |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | if ($propertyInfo->isObject()) { |
748 | 748 | /** @var ObjectPropertyInfo $propertyInfo */ |
749 | 749 | $variableType = $this->getRelativeClassName($propertyInfo->className()); |
750 | - $methodTypeHint = $variableType.' '; |
|
750 | + $methodTypeHint = $variableType.' '; |
|
751 | 751 | } else { |
752 | 752 | /** @var PropertyInfo $propertyInfo */ |
753 | 753 | $variableType = $propertyInfo->phpType(); |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | '<variableName>' => $variableName, |
779 | 779 | '<methodName>' => $methodName, |
780 | 780 | '<fieldName>' => $fieldName, |
781 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = '.$defaultValue) : '' |
|
781 | + '<variableDefault>' => ($defaultValue !== null) ? (' = '.$defaultValue) : '' |
|
782 | 782 | ); |
783 | 783 | |
784 | 784 | $method = str_replace( |
@@ -853,9 +853,9 @@ discard block |
||
853 | 853 | protected function generateFieldMappingPropertyDocBlock($property) |
854 | 854 | { |
855 | 855 | $lines = array(); |
856 | - $lines[] = $this->spaces . '/**'; |
|
857 | - $lines[] = $this->spaces . ' * @var '.$property->phpType(); |
|
858 | - $lines[] = $this->spaces . ' */'; |
|
856 | + $lines[] = $this->spaces.'/**'; |
|
857 | + $lines[] = $this->spaces.' * @var '.$property->phpType(); |
|
858 | + $lines[] = $this->spaces.' */'; |
|
859 | 859 | |
860 | 860 | return implode("\n", $lines); |
861 | 861 | } |
@@ -884,9 +884,9 @@ discard block |
||
884 | 884 | } |
885 | 885 | |
886 | 886 | $lines = array(); |
887 | - $lines[] = $this->spaces . '/**'; |
|
888 | - $lines[] = $this->spaces . ' * @var '.$className; |
|
889 | - $lines[] = $this->spaces . ' */'; |
|
887 | + $lines[] = $this->spaces.'/**'; |
|
888 | + $lines[] = $this->spaces.' * @var '.$className; |
|
889 | + $lines[] = $this->spaces.' */'; |
|
890 | 890 | |
891 | 891 | return implode("\n", $lines); |
892 | 892 | } |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | |
928 | 928 | if ($inClass) { |
929 | 929 | $inClass = false; |
930 | - $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1]; |
|
930 | + $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1]; |
|
931 | 931 | $this->staticReflection[$lastSeenClass]['properties'] = array(); |
932 | 932 | $this->staticReflection[$lastSeenClass]['methods'] = array(); |
933 | 933 | } |
@@ -935,16 +935,16 @@ discard block |
||
935 | 935 | if ($token[0] == T_NAMESPACE) { |
936 | 936 | $lastSeenNamespace = ""; |
937 | 937 | $inNamespace = true; |
938 | - } elseif ($token[0] == T_CLASS && $tokens[$i-1][0] != T_DOUBLE_COLON) { |
|
938 | + } elseif ($token[0] == T_CLASS && $tokens[$i - 1][0] != T_DOUBLE_COLON) { |
|
939 | 939 | $inClass = true; |
940 | 940 | } elseif ($token[0] == T_FUNCTION) { |
941 | - if ($tokens[$i+2][0] == T_STRING) { |
|
942 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]); |
|
943 | - } elseif ($tokens[$i+2] == "&" && $tokens[$i+3][0] == T_STRING) { |
|
944 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]); |
|
941 | + if ($tokens[$i + 2][0] == T_STRING) { |
|
942 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]); |
|
943 | + } elseif ($tokens[$i + 2] == "&" && $tokens[$i + 3][0] == T_STRING) { |
|
944 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]); |
|
945 | 945 | } |
946 | - } elseif (in_array($token[0], array(T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED)) && $tokens[$i+2][0] != T_FUNCTION) { |
|
947 | - $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1); |
|
946 | + } elseif (in_array($token[0], array(T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED)) && $tokens[$i + 2][0] != T_FUNCTION) { |
|
947 | + $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1); |
|
948 | 948 | } |
949 | 949 | } |
950 | 950 | } |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | if ($this->hasNamespace($className)) { |
1020 | 1020 | return $this->getClassName($className); |
1021 | 1021 | } else { |
1022 | - return '\\' . $className; |
|
1022 | + return '\\'.$className; |
|
1023 | 1023 | } |
1024 | 1024 | } |
1025 | 1025 | |
@@ -1120,8 +1120,8 @@ discard block |
||
1120 | 1120 | $lines = explode("\n", $code); |
1121 | 1121 | |
1122 | 1122 | foreach ($lines as $key => $value) { |
1123 | - if ( ! empty($value)) { |
|
1124 | - $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; |
|
1123 | + if (!empty($value)) { |
|
1124 | + $lines[$key] = str_repeat($this->spaces, $num).$lines[$key]; |
|
1125 | 1125 | } |
1126 | 1126 | } |
1127 | 1127 | |
@@ -1150,7 +1150,7 @@ discard block |
||
1150 | 1150 | } |
1151 | 1151 | |
1152 | 1152 | if (is_string($value)) { |
1153 | - return "'" . $value . "'"; |
|
1153 | + return "'".$value."'"; |
|
1154 | 1154 | } |
1155 | 1155 | |
1156 | 1156 | if (is_bool($value)) { |
@@ -1183,7 +1183,7 @@ discard block |
||
1183 | 1183 | $type = self::PROPERTY_TYPE_MAP[$type] ?? $type; |
1184 | 1184 | } |
1185 | 1185 | |
1186 | - return ($nullable ? '?' : '') . $type; |
|
1186 | + return ($nullable ? '?' : '').$type; |
|
1187 | 1187 | } |
1188 | 1188 | |
1189 | 1189 | /** |
@@ -1202,7 +1202,7 @@ discard block |
||
1202 | 1202 | return ''; |
1203 | 1203 | } |
1204 | 1204 | |
1205 | - return ' ' . $this->getPropertyTypeHint($property->phpType(), $property->isNullable()); |
|
1205 | + return ' '.$this->getPropertyTypeHint($property->phpType(), $property->isNullable()); |
|
1206 | 1206 | } |
1207 | 1207 | |
1208 | 1208 | /** |
@@ -1236,7 +1236,7 @@ discard block |
||
1236 | 1236 | } |
1237 | 1237 | } |
1238 | 1238 | |
1239 | - return ' ' . $this->getPropertyTypeHint($type, $property->isRelation()); |
|
1239 | + return ' '.$this->getPropertyTypeHint($type, $property->isRelation()); |
|
1240 | 1240 | } |
1241 | 1241 | |
1242 | 1242 | //---------------------- mutators |
@@ -1366,7 +1366,7 @@ discard block |
||
1366 | 1366 | public function setFieldVisibility(string $visibility): void |
1367 | 1367 | { |
1368 | 1368 | if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) { |
1369 | - throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility); |
|
1369 | + throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility); |
|
1370 | 1370 | } |
1371 | 1371 | |
1372 | 1372 | $this->fieldVisibility = $visibility; |
@@ -50,7 +50,7 @@ |
||
50 | 50 | switch ($platform->name()) { |
51 | 51 | case 'mysql': |
52 | 52 | $connection->executeUpdate('UPDATE '.$metadata->sequence['table'] |
53 | - .' SET '. $metadata->sequence['column'].' = LAST_INSERT_ID('.$metadata->sequence['column'].'+1)'); |
|
53 | + .' SET '.$metadata->sequence['column'].' = LAST_INSERT_ID('.$metadata->sequence['column'].'+1)'); |
|
54 | 54 | return (string) $connection->lastInsertId(); |
55 | 55 | |
56 | 56 | case 'sqlite': |