@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | */ |
154 | 154 | public function boolean($name, $default = null) |
155 | 155 | { |
156 | - return $this->add($name, TypeInterface::BOOLEAN, $default !== null ? (bool)$default : null); |
|
156 | + return $this->add($name, TypeInterface::BOOLEAN, $default !== null ? (bool) $default : null); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | public function field($name) |
606 | 606 | { |
607 | 607 | if (!isset($this->fields[$name])) { |
608 | - throw new \RuntimeException('Field ' . $name . ' not found'); |
|
608 | + throw new \RuntimeException('Field '.$name.' not found'); |
|
609 | 609 | } |
610 | 610 | |
611 | 611 | $this->current = $name; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $relation = parent::relation($relationName); |
53 | 53 | |
54 | 54 | if ($this->isDiscriminatedMapper() && $relation['type'] == Relation::BY_INHERITANCE) { |
55 | - throw new \RuntimeException('Relation type not allowed from relation "' . $relationName . '" in ' . $this->getEntityClass()); |
|
55 | + throw new \RuntimeException('Relation type not allowed from relation "'.$relationName.'" in '.$this->getEntityClass()); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | return $relation; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $discriminatorField = $this->metadata()->attributes[$this->discriminatorColumn]['field']; |
149 | 149 | |
150 | 150 | if (empty($data[$discriminatorField])) { |
151 | - throw new \Exception('Discriminator field "' . $discriminatorField . '" not found'); |
|
151 | + throw new \Exception('Discriminator field "'.$discriminatorField.'" not found'); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | return $data[$discriminatorField]; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | public function getDiscriminatorType($discriminatorValue) |
167 | 167 | { |
168 | 168 | if (empty($this->discriminatorMap[$discriminatorValue])) { |
169 | - throw new \Exception('Unknown discriminator type "' . $discriminatorValue . '"'); |
|
169 | + throw new \Exception('Unknown discriminator type "'.$discriminatorValue.'"'); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | return $this->discriminatorMap[$discriminatorValue]; |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | $attributePath = $attribute; |
843 | 843 | $path = null; |
844 | 844 | } else { |
845 | - $attributePath = $embeddedMeta['path'] . '.' . $attribute; |
|
845 | + $attributePath = $embeddedMeta['path'].'.'.$attribute; |
|
846 | 846 | $path = $embeddedMeta['path']; |
847 | 847 | } |
848 | 848 | |
@@ -900,7 +900,7 @@ discard block |
||
900 | 900 | : $this->connection, |
901 | 901 | 'table' => isset($sequence['table']) |
902 | 902 | ? $sequence['table'] |
903 | - : $this->table . '_seq', |
|
903 | + : $this->table.'_seq', |
|
904 | 904 | 'column' => isset($sequence['column']) |
905 | 905 | ? $sequence['column'] |
906 | 906 | : 'id', |
@@ -88,7 +88,7 @@ |
||
88 | 88 | $this->remove($attribute); |
89 | 89 | } |
90 | 90 | |
91 | - $this->criteria[$filter] = $value; |
|
91 | + $this->criteria[$filter] = $value; |
|
92 | 92 | $this->inputs[$attribute][] = $filter; |
93 | 93 | } |
94 | 94 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | } |
27 | 27 | |
28 | 28 | foreach ($data as $attribute => $value) { |
29 | - $method = 'set' . ucfirst($attribute); |
|
29 | + $method = 'set'.ucfirst($attribute); |
|
30 | 30 | $exists = property_exists($this, $attribute); |
31 | 31 | |
32 | 32 | if ($exists && $this->$attribute instanceof ImportableInterface && !$value instanceof ImportableInterface) { |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function hydrate($object, array $data) |
22 | 22 | { |
23 | - $privatePrefix = "\0" . get_class($object) . "\0"; |
|
23 | + $privatePrefix = "\0".get_class($object)."\0"; |
|
24 | 24 | $privatePrefixLen = strlen($privatePrefix); |
25 | 25 | |
26 | 26 | foreach ((array) $object as $name => $property) { |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | |
39 | 39 | if ($property instanceof ImportableInterface && is_array($value)) { |
40 | 40 | $property->import($value); |
41 | - } elseif (method_exists($object, 'set' . ucfirst($name))) { |
|
42 | - $object->{'set' . ucfirst($name)}($value); |
|
41 | + } elseif (method_exists($object, 'set'.ucfirst($name))) { |
|
42 | + $object->{'set'.ucfirst($name)}($value); |
|
43 | 43 | } else { |
44 | 44 | $object->$name = $value; |
45 | 45 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $values = []; |
55 | 55 | $attributes = array_flip($attributes); |
56 | 56 | |
57 | - $privatePrefix = "\0" . get_class($object) . "\0"; |
|
57 | + $privatePrefix = "\0".get_class($object)."\0"; |
|
58 | 58 | $privatePrefixLen = strlen($privatePrefix); |
59 | 59 | |
60 | 60 | foreach ((array) $object as $name => $property) { |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public function hydratorClassName() |
126 | 126 | { |
127 | - return 'Hydrator_' . str_replace('\\', '_', $this->className); |
|
127 | + return 'Hydrator_'.str_replace('\\', '_', $this->className); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function hydratorFullClassName() |
136 | 136 | { |
137 | - return $this->hydratorNamespace() . '\\' . $this->hydratorClassName(); |
|
137 | + return $this->hydratorNamespace().'\\'.$this->hydratorClassName(); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | if (!isset($classes[$class])) { |
167 | 167 | $classes[$class] = true; |
168 | 168 | |
169 | - $property = '__' . str_replace('\\', '_', $class) . '_hydrator'; |
|
169 | + $property = '__'.str_replace('\\', '_', $class).'_hydrator'; |
|
170 | 170 | $this->embeddedHydrators[$class] = $property; |
171 | 171 | } |
172 | 172 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | protected function generateEmbeddedHydrate(AttributeInfo $attribute) |
259 | 259 | { |
260 | 260 | // We can have multiple entity classes for one attribute : morph |
261 | - $varName = '$__rel_' . str_replace('.', '_', $attribute->name()); |
|
261 | + $varName = '$__rel_'.str_replace('.', '_', $attribute->name()); |
|
262 | 262 | |
263 | 263 | $hydrators = []; |
264 | 264 | |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | return '$this'; |
294 | 294 | } |
295 | 295 | |
296 | - return '$this->' . $this->embeddedHydrators[$class]; |
|
296 | + return '$this->'.$this->embeddedHydrators[$class]; |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | /** |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | */ |
306 | 306 | protected function normalizeClassName($className) |
307 | 307 | { |
308 | - return '\\' . ltrim($className, '\\'); |
|
308 | + return '\\'.ltrim($className, '\\'); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | /** |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | $lines[] = "'{$attribute->name()}' => ({$this->generateExtractValue($attribute)})"; |
349 | 349 | } |
350 | 350 | |
351 | - return 'return [' . implode(', ', $lines) . '];'; |
|
351 | + return 'return ['.implode(', ', $lines).'];'; |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | /** |
@@ -391,8 +391,8 @@ discard block |
||
391 | 391 | $line = ''; |
392 | 392 | |
393 | 393 | if ($attribute->isEmbedded()) { |
394 | - $varName = '$__rel_' . str_replace('.', '_', $attribute->name()); |
|
395 | - $line .= '(' . $varName . ' = '.$this->accessor->getter('$object', $attribute->property()) . ") === null ? null : "; |
|
394 | + $varName = '$__rel_'.str_replace('.', '_', $attribute->name()); |
|
395 | + $line .= '('.$varName.' = '.$this->accessor->getter('$object', $attribute->property()).") === null ? null : "; |
|
396 | 396 | |
397 | 397 | foreach ($attribute->embedded()->classes() as $class) { |
398 | 398 | if ($this->resolver->isImportable($class)) { |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | */ |
627 | 627 | protected function generateExtractOneCaseEmbedded(EmbeddedInfo $embedded) |
628 | 628 | { |
629 | - $varName = '$__' . str_replace('.', '_', $embedded->path()); |
|
629 | + $varName = '$__'.str_replace('.', '_', $embedded->path()); |
|
630 | 630 | $code = $this->accessors->embedded($embedded)->getEmbedded($varName, false); |
631 | 631 | |
632 | 632 | return $this->code->lines([$code, 'return '.$varName.';']); |
@@ -317,7 +317,7 @@ |
||
317 | 317 | return array_unique($classes); |
318 | 318 | |
319 | 319 | default: |
320 | - throw new HydratorException($this->mapper->getEntityClass(), 'Cannot handle relation type ' . $relation['type']); |
|
320 | + throw new HydratorException($this->mapper->getEntityClass(), 'Cannot handle relation type '.$relation['type']); |
|
321 | 321 | } |
322 | 322 | } |
323 | 323 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | return ''; |
39 | 39 | } |
40 | 40 | |
41 | - return 'namespace ' . $namespace . ';'; |
|
41 | + return 'namespace '.$namespace.';'; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $out = ''; |
55 | 55 | |
56 | 56 | foreach ($names as $property) { |
57 | - $out .= $visibility.' $' . $property . ';'.$this->eol; |
|
57 | + $out .= $visibility.' $'.$property.';'.$this->eol; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | return $out; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function simpleConstructor($properties) |
71 | 71 | { |
72 | - $parameters = implode(', ', array_map(function ($p) { return '$'.$p; }, $properties)); |
|
72 | + $parameters = implode(', ', array_map(function($p) { return '$'.$p; }, $properties)); |
|
73 | 73 | $content = ''; |
74 | 74 | |
75 | 75 | foreach ($properties as $property) { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $content .= $this->eol; |
78 | 78 | } |
79 | 79 | |
80 | - $content .= '$this->' . $property . ' = $' . $property . ';'; |
|
80 | + $content .= '$this->'.$property.' = $'.$property.';'; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | { |
102 | 102 | $spaces = str_repeat($this->tab, $tabs); |
103 | 103 | |
104 | - return $spaces . str_replace($this->eol, $this->eol.$spaces, $code); |
|
104 | + return $spaces.str_replace($this->eol, $this->eol.$spaces, $code); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * |
160 | 160 | * @return string |
161 | 161 | */ |
162 | - public function switch($varName, array $cases, $default = null) |
|
162 | + public function switch ($varName, array $cases, $default = null) |
|
163 | 163 | { |
164 | 164 | $code = 'switch ('.$varName.') {'.$this->eol; |
165 | 165 |