@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | */ |
| 223 | 223 | public function setReadOnly($flag) |
| 224 | 224 | { |
| 225 | - $this->readOnly = (bool)$flag; |
|
| 225 | + $this->readOnly = (bool) $flag; |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | /** |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | public function setQuoteIdentifier($flag) |
| 262 | 262 | { |
| 263 | - $this->useQuoteIdentifier = (bool)$flag; |
|
| 263 | + $this->useQuoteIdentifier = (bool) $flag; |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | /** |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | public function setGenerator($generator) |
| 282 | 282 | { |
| 283 | 283 | if (!is_string($generator) && !$generator instanceof GeneratorInterface) { |
| 284 | - throw new LogicException('Trying to set an invalid generator in "' . get_class($this) . '"'); |
|
| 284 | + throw new LogicException('Trying to set an invalid generator in "'.get_class($this).'"'); |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | $this->generator = $generator; |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | $relations = $this->relations(); |
| 516 | 516 | |
| 517 | 517 | if (!isset($relations[$relationName])) { |
| 518 | - throw new RelationNotFoundException('Relation "' . $relationName . '" is not set in ' . $this->metadata->entityName); |
|
| 518 | + throw new RelationNotFoundException('Relation "'.$relationName.'" is not set in '.$this->metadata->entityName); |
|
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | return $relations[$relationName]; |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | */ |
| 690 | 690 | public function scopes() |
| 691 | 691 | { |
| 692 | - throw new LogicException('No scopes have been defined in "' . get_class($this) . '"'); |
|
| 692 | + throw new LogicException('No scopes have been defined in "'.get_class($this).'"'); |
|
| 693 | 693 | } |
| 694 | 694 | |
| 695 | 695 | /** |
@@ -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 | } |