@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | #[ReadOperation] |
| 325 | 325 | public function loadRelations($entity, $relations): void |
| 326 | 326 | { |
| 327 | - foreach (Relation::sanitizeRelations((array)$relations) as $relationName => $meta) { |
|
| 327 | + foreach (Relation::sanitizeRelations((array) $relations) as $relationName => $meta) { |
|
| 328 | 328 | $this->relation($relationName)->loadIfNotLoaded( |
| 329 | 329 | new SingleEntityIndexer($this->mapper, $entity), |
| 330 | 330 | $meta['relations'], |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | #[ReadOperation] |
| 348 | 348 | public function reloadRelations($entity, $relations): void |
| 349 | 349 | { |
| 350 | - foreach (Relation::sanitizeRelations((array)$relations) as $relationName => $meta) { |
|
| 350 | + foreach (Relation::sanitizeRelations((array) $relations) as $relationName => $meta) { |
|
| 351 | 351 | $this->relation($relationName)->load( |
| 352 | 352 | new SingleEntityIndexer($this->mapper, $entity), |
| 353 | 353 | $meta['relations'], |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | #[WriteOperation] |
| 388 | 388 | public function saveAll($entity, $relations): int |
| 389 | 389 | { |
| 390 | - $relations = Relation::sanitizeRelations((array)$relations); |
|
| 390 | + $relations = Relation::sanitizeRelations((array) $relations); |
|
| 391 | 391 | |
| 392 | 392 | return $this->transaction(function() use($entity, $relations) { |
| 393 | 393 | $nb = $this->save($entity); |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | #[WriteOperation] |
| 407 | 407 | public function deleteAll($entity, $relations): int |
| 408 | 408 | { |
| 409 | - $relations = Relation::sanitizeRelations((array)$relations); |
|
| 409 | + $relations = Relation::sanitizeRelations((array) $relations); |
|
| 410 | 410 | |
| 411 | 411 | return $this->transaction(function() use($entity, $relations) { |
| 412 | 412 | $nb = $this->delete($entity); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | public function setGenerator($generator): void |
| 289 | 289 | { |
| 290 | 290 | if (!is_string($generator) && !$generator instanceof GeneratorInterface) { |
| 291 | - throw new LogicException('Trying to set an invalid generator in "' . get_class($this) . '"'); |
|
| 291 | + throw new LogicException('Trying to set an invalid generator in "'.get_class($this).'"'); |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | $this->generator = $generator; |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | $relations = $this->relations(); |
| 515 | 515 | |
| 516 | 516 | if (!isset($relations[$relationName])) { |
| 517 | - throw new RelationNotFoundException('Relation "' . $relationName . '" is not set in ' . $this->metadata->entityName); |
|
| 517 | + throw new RelationNotFoundException('Relation "'.$relationName.'" is not set in '.$this->metadata->entityName); |
|
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | return $relations[$relationName]; |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | */ |
| 689 | 689 | public function scopes() |
| 690 | 690 | { |
| 691 | - throw new LogicException('No scopes have been defined in "' . get_class($this) . '"'); |
|
| 691 | + throw new LogicException('No scopes have been defined in "'.get_class($this).'"'); |
|
| 692 | 692 | } |
| 693 | 693 | |
| 694 | 694 | /** |
@@ -890,7 +890,7 @@ discard block |
||
| 890 | 890 | $attributePath = $attribute; |
| 891 | 891 | $path = null; |
| 892 | 892 | } else { |
| 893 | - $attributePath = $embeddedMeta['path'] . '.' . $attribute; |
|
| 893 | + $attributePath = $embeddedMeta['path'].'.'.$attribute; |
|
| 894 | 894 | $path = $embeddedMeta['path']; |
| 895 | 895 | } |
| 896 | 896 | |
@@ -944,7 +944,7 @@ discard block |
||
| 944 | 944 | |
| 945 | 945 | $this->sequence = [ |
| 946 | 946 | 'connection' => $sequence['connection'] ?? $this->connection, |
| 947 | - 'table' => $sequence['table'] ?? $this->table . '_seq', |
|
| 947 | + 'table' => $sequence['table'] ?? $this->table.'_seq', |
|
| 948 | 948 | 'column' => $sequence['column'] ?? 'id', |
| 949 | 949 | 'options' => $sequence['tableOptions'] ?? [], |
| 950 | 950 | ]; |
@@ -114,7 +114,7 @@ |
||
| 114 | 114 | private function getConnectionParameters(string $connectionName): array |
| 115 | 115 | { |
| 116 | 116 | if (!isset($this->parametersMap[$connectionName])) { |
| 117 | - throw new DBALException('Connection name "' . $connectionName . '" is not set'); |
|
| 117 | + throw new DBALException('Connection name "'.$connectionName.'" is not set'); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | $parameters = $this->parametersMap[$connectionName]; |
@@ -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 | } |