@@ -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 |