@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function generateProxyClasses(array $classes) : int |
58 | 58 | { |
59 | - $concreteClasses = array_filter($classes, static function (ClassMetadata $metadata) : bool { |
|
59 | + $concreteClasses = array_filter($classes, static function(ClassMetadata $metadata) : bool { |
|
60 | 60 | return ! ($metadata->isMappedSuperclass || $metadata->getReflectionClass()->isAbstract()); |
61 | 61 | }); |
62 | 62 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | ->proxyFactory |
66 | 66 | ->createProxy( |
67 | 67 | $metadata->getClassName(), |
68 | - static function () { |
|
68 | + static function() { |
|
69 | 69 | // empty closure, serves its purpose, for now |
70 | 70 | }, |
71 | 71 | $this->skippedFieldsFqns($metadata) |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | ->getUnitOfWork() |
90 | 90 | ->getEntityPersister($metadata->getClassName()); |
91 | 91 | |
92 | - $proxyInstance = $this |
|
92 | + $proxyInstance = $this |
|
93 | 93 | ->proxyFactory |
94 | 94 | ->createProxy( |
95 | 95 | $metadata->getClassName(), |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | private function makeInitializer(ClassMetadata $metadata, EntityPersister $persister) : Closure |
110 | 110 | { |
111 | - return static function ( |
|
111 | + return static function( |
|
112 | 112 | GhostObjectInterface $ghostObject, |
113 | 113 | string $method, |
114 | 114 | // we don't care |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $identifier = $persister->getIdentifier($ghostObject); |
127 | 127 | |
128 | 128 | // @TODO how do we use `$properties` in the persister? That would be a massive optimisation |
129 | - if (! $persister->loadById($identifier, $ghostObject)) { |
|
129 | + if ( ! $persister->loadById($identifier, $ghostObject)) { |
|
130 | 130 | $initializer = $originalInitializer; |
131 | 131 | |
132 | 132 | throw EntityNotFoundException::fromClassNameAndIdentifier( |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $transientFieldsFqns = []; |
159 | 159 | |
160 | 160 | foreach ($metadata->getDeclaredPropertiesIterator() as $name => $property) { |
161 | - if (! $property instanceof TransientMetadata) { |
|
161 | + if ( ! $property instanceof TransientMetadata) { |
|
162 | 162 | continue; |
163 | 163 | } |
164 | 164 | |
@@ -196,11 +196,11 @@ discard block |
||
196 | 196 | private function propertyFqcn(ReflectionProperty $property) : string |
197 | 197 | { |
198 | 198 | if ($property->isPrivate()) { |
199 | - return "\0" . $property->getDeclaringClass()->getName() . "\0" . $property->getName(); |
|
199 | + return "\0".$property->getDeclaringClass()->getName()."\0".$property->getName(); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | if ($property->isProtected()) { |
203 | - return "\0*\0" . $property->getName(); |
|
203 | + return "\0*\0".$property->getName(); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | return $property->getName(); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public static function scheduleInsertForManagedEntity($entity) |
32 | 32 | { |
33 | - return new self('A managed+dirty entity ' . self::objToStr($entity) . ' can not be scheduled for insertion.'); |
|
33 | + return new self('A managed+dirty entity '.self::objToStr($entity).' can not be scheduled for insertion.'); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public static function scheduleInsertForRemovedEntity($entity) |
42 | 42 | { |
43 | - return new self('Removed entity ' . self::objToStr($entity) . ' can not be scheduled for insertion.'); |
|
43 | + return new self('Removed entity '.self::objToStr($entity).' can not be scheduled for insertion.'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public static function scheduleInsertTwice($entity) |
52 | 52 | { |
53 | - return new self('Entity ' . self::objToStr($entity) . ' can not be scheduled for insertion twice.'); |
|
53 | + return new self('Entity '.self::objToStr($entity).' can not be scheduled for insertion twice.'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | public static function entityWithoutIdentity($className, $entity) |
63 | 63 | { |
64 | 64 | return new self( |
65 | - "The given entity of type '" . $className . "' (" . self::objToStr($entity) . ') has no identity/no ' . |
|
65 | + "The given entity of type '".$className."' (".self::objToStr($entity).') has no identity/no '. |
|
66 | 66 | 'id values set. It cannot be added to the identity map.' |
67 | 67 | ); |
68 | 68 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public static function readOnlyRequiresManagedEntity($entity) |
76 | 76 | { |
77 | - return new self('Only managed entities can be marked or checked as read only. But ' . self::objToStr($entity) . ' is not'); |
|
77 | + return new self('Only managed entities can be marked or checked as read only. But '.self::objToStr($entity).' is not'); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | public static function newEntitiesFoundThroughRelationships($newEntitiesWithAssociations) |
86 | 86 | { |
87 | 87 | $errorMessages = array_map( |
88 | - static function (array $newEntityWithAssociation) : string { |
|
88 | + static function(array $newEntityWithAssociation) : string { |
|
89 | 89 | [$associationMetadata, $entity] = $newEntityWithAssociation; |
90 | 90 | |
91 | 91 | return self::newEntityFoundThroughRelationshipMessage($associationMetadata, $entity); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public static function entityNotManaged($entity) |
156 | 156 | { |
157 | - return new self('Entity ' . self::objToStr($entity) . ' is not managed. An entity is managed if its fetched ' . |
|
157 | + return new self('Entity '.self::objToStr($entity).' is not managed. An entity is managed if its fetched '. |
|
158 | 158 | 'from the database or registered as new through EntityManager#persist'); |
159 | 159 | } |
160 | 160 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | */ |
167 | 167 | public static function entityHasNoIdentity($entity, $operation) |
168 | 168 | { |
169 | - return new self('Entity has no identity, therefore ' . $operation . ' cannot be performed. ' . self::objToStr($entity)); |
|
169 | + return new self('Entity has no identity, therefore '.$operation.' cannot be performed. '.self::objToStr($entity)); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | /** |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public static function entityIsRemoved($entity, $operation) |
179 | 179 | { |
180 | - return new self('Entity is removed, therefore ' . $operation . ' cannot be performed. ' . self::objToStr($entity)); |
|
180 | + return new self('Entity is removed, therefore '.$operation.' cannot be performed. '.self::objToStr($entity)); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | public static function detachedEntityCannot($entity, $operation) |
190 | 190 | { |
191 | - return new self('Detached entity ' . self::objToStr($entity) . ' cannot be ' . $operation); |
|
191 | + return new self('Detached entity '.self::objToStr($entity).' cannot be '.$operation); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | /** |
@@ -200,8 +200,8 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public static function invalidObject($context, $given, $parameterIndex = 1) |
202 | 202 | { |
203 | - return new self($context . ' expects parameter ' . $parameterIndex . |
|
204 | - ' to be an entity object, ' . gettype($given) . ' given.'); |
|
203 | + return new self($context.' expects parameter '.$parameterIndex. |
|
204 | + ' to be an entity object, '.gettype($given).' given.'); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public static function invalidCompositeIdentifier() |
211 | 211 | { |
212 | - return new self('Binding an entity with a composite primary key to a query is not supported. ' . |
|
212 | + return new self('Binding an entity with a composite primary key to a query is not supported. '. |
|
213 | 213 | 'You should split the parameter into the explicit fields and bind them separately.'); |
214 | 214 | } |
215 | 215 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | */ |
247 | 247 | private static function objToStr($obj) : string |
248 | 248 | { |
249 | - return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj); |
|
249 | + return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
@@ -255,15 +255,15 @@ discard block |
||
255 | 255 | private static function newEntityFoundThroughRelationshipMessage(AssociationMetadata $association, $entity) : string |
256 | 256 | { |
257 | 257 | return 'A new entity was found through the relationship \'' |
258 | - . $association->getSourceEntity() . '#' . $association->getName() . '\' that was not' |
|
259 | - . ' configured to cascade persist operations for entity: ' . self::objToStr($entity) . '.' |
|
258 | + . $association->getSourceEntity().'#'.$association->getName().'\' that was not' |
|
259 | + . ' configured to cascade persist operations for entity: '.self::objToStr($entity).'.' |
|
260 | 260 | . ' To solve this issue: Either explicitly call EntityManager#persist()' |
261 | 261 | . ' on this unknown entity or configure cascade persist' |
262 | 262 | . ' this association in the mapping for example @ManyToOne(..,cascade={"persist"}).' |
263 | 263 | . (method_exists($entity, '__toString') |
264 | 264 | ? '' |
265 | 265 | : ' If you cannot find out which entity causes the problem implement \'' |
266 | - . $association->getTargetEntity() . '#__toString()\' to get a clue.' |
|
266 | + . $association->getTargetEntity().'#__toString()\' to get a clue.' |
|
267 | 267 | ); |
268 | 268 | } |
269 | 269 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | // remove namespace separators from remaining class name |
47 | 47 | $fileName = str_replace('\\', '', $classNameRelativeToMetadataNamespace); |
48 | 48 | |
49 | - return $metadataDir . DIRECTORY_SEPARATOR . $fileName . '.php'; |
|
49 | + return $metadataDir.DIRECTORY_SEPARATOR.$fileName.'.php'; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | ) : Closure { |
64 | 64 | $metadataNamespace = ltrim($metadataNamespace, '\\'); |
65 | 65 | |
66 | - if (! ($notFoundCallback === null || is_callable($notFoundCallback))) { |
|
66 | + if ( ! ($notFoundCallback === null || is_callable($notFoundCallback))) { |
|
67 | 67 | $type = is_object($notFoundCallback) ? get_class($notFoundCallback) : gettype($notFoundCallback); |
68 | 68 | |
69 | 69 | throw new InvalidArgumentException( |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | ); |
72 | 72 | } |
73 | 73 | |
74 | - $autoloader = static function ($className) use ($metadataDir, $metadataNamespace, $notFoundCallback) { |
|
74 | + $autoloader = static function($className) use ($metadataDir, $metadataNamespace, $notFoundCallback) { |
|
75 | 75 | if (strpos($className, $metadataNamespace) === 0) { |
76 | 76 | $file = Autoloader::resolveFile($metadataDir, $metadataNamespace, $className); |
77 | 77 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $this->ensureDirectoryIsReady(dirname($filePath)); |
38 | 38 | |
39 | - $tmpFileName = $filePath . '.' . uniqid('', true); |
|
39 | + $tmpFileName = $filePath.'.'.uniqid('', true); |
|
40 | 40 | |
41 | 41 | file_put_contents($tmpFileName, $sourceCode); |
42 | 42 | @chmod($tmpFileName, 0664); |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | */ |
51 | 51 | private function ensureDirectoryIsReady(string $directory) |
52 | 52 | { |
53 | - if (! is_dir($directory) && (@mkdir($directory, 0775, true) === false)) { |
|
53 | + if ( ! is_dir($directory) && (@mkdir($directory, 0775, true) === false)) { |
|
54 | 54 | throw new RuntimeException(sprintf('Your metadata directory "%s" must be writable', $directory)); |
55 | 55 | } |
56 | 56 | |
57 | - if (! is_writable($directory)) { |
|
57 | + if ( ! is_writable($directory)) { |
|
58 | 58 | throw new RuntimeException(sprintf('Your proxy directory "%s" must be writable', $directory)); |
59 | 59 | } |
60 | 60 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | */ |
43 | 43 | public function register($object) |
44 | 44 | { |
45 | - if (! is_object($object)) { |
|
45 | + if ( ! is_object($object)) { |
|
46 | 46 | throw new InvalidArgumentException(sprintf('An object was expected, but got "%s".', gettype($object))); |
47 | 47 | } |
48 | 48 |
@@ -24,30 +24,30 @@ |
||
24 | 24 | */ |
25 | 25 | public function export($value, int $indentationLevel = 0) : string |
26 | 26 | { |
27 | - if (! is_array($value)) { |
|
27 | + if ( ! is_array($value)) { |
|
28 | 28 | return var_export($value, true); |
29 | 29 | } |
30 | 30 | |
31 | 31 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
32 | - $longestKey = array_reduce(array_keys($value), static function ($k, $v) { |
|
32 | + $longestKey = array_reduce(array_keys($value), static function($k, $v) { |
|
33 | 33 | return (string) (strlen((string) $k) > strlen((string) $v) ? $k : $v); |
34 | 34 | }); |
35 | 35 | $maxKeyLength = strlen($longestKey) + (is_numeric($longestKey) ? 0 : 2); |
36 | 36 | |
37 | 37 | $lines = []; |
38 | 38 | |
39 | - $lines[] = $indentation . '['; |
|
39 | + $lines[] = $indentation.'['; |
|
40 | 40 | |
41 | 41 | foreach ($value as $entryKey => $entryValue) { |
42 | 42 | $lines[] = sprintf( |
43 | 43 | '%s%s => %s,', |
44 | - $indentation . self::INDENTATION, |
|
44 | + $indentation.self::INDENTATION, |
|
45 | 45 | str_pad(var_export($entryKey, true), $maxKeyLength), |
46 | 46 | ltrim($this->export($entryValue, $indentationLevel + 1)) |
47 | 47 | ); |
48 | 48 | } |
49 | 49 | |
50 | - $lines[] = $indentation . ']'; |
|
50 | + $lines[] = $indentation.']'; |
|
51 | 51 | |
52 | 52 | return implode(PHP_EOL, $lines); |
53 | 53 | } |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | |
417 | 417 | if (isset($manyToOneElement['fetch'])) { |
418 | 418 | $association->setFetchMode( |
419 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $manyToOneElement['fetch']) |
|
419 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $manyToOneElement['fetch']) |
|
420 | 420 | ); |
421 | 421 | } |
422 | 422 | |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | $fieldName = (string) $overrideElement['name']; |
570 | 570 | $property = $metadata->getProperty($fieldName); |
571 | 571 | |
572 | - if (! $property) { |
|
572 | + if ( ! $property) { |
|
573 | 573 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
574 | 574 | } |
575 | 575 | |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | // Check for fetch |
628 | 628 | if (isset($overrideElement['fetch'])) { |
629 | 629 | $override->setFetchMode( |
630 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $overrideElement['fetch']) |
|
630 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $overrideElement['fetch']) |
|
631 | 631 | ); |
632 | 632 | } |
633 | 633 | |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | // Evaluate <lifecycle-callbacks...> |
639 | 639 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
640 | 640 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
641 | - $eventName = constant(Events::class . '::' . (string) $lifecycleCallback['type']); |
|
641 | + $eventName = constant(Events::class.'::'.(string) $lifecycleCallback['type']); |
|
642 | 642 | $methodName = (string) $lifecycleCallback['method']; |
643 | 643 | |
644 | 644 | $metadata->addLifecycleCallback($methodName, $eventName); |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | foreach ($xmlRoot->{'entity-listeners'}->{'entity-listener'} as $listenerElement) { |
651 | 651 | $listenerClassName = (string) $listenerElement['class']; |
652 | 652 | |
653 | - if (! class_exists($listenerClassName)) { |
|
653 | + if ( ! class_exists($listenerClassName)) { |
|
654 | 654 | throw Mapping\MappingException::entityListenerClassNotFound( |
655 | 655 | $listenerClassName, |
656 | 656 | $metadata->getClassName() |
@@ -816,7 +816,7 @@ discard block |
||
816 | 816 | $fieldName = null |
817 | 817 | ) { |
818 | 818 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
819 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
819 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
820 | 820 | |
821 | 821 | $region = (string) ($cacheMapping['region'] ?? $defaultRegion); |
822 | 822 | $usage = isset($cacheMapping['usage']) |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | Events::preFlush, |
845 | 845 | ]; |
846 | 846 | |
847 | - return array_filter($events, static function ($eventName) use ($method) { |
|
847 | + return array_filter($events, static function($eventName) use ($method) { |
|
848 | 848 | return $eventName === $method->getName(); |
849 | 849 | }); |
850 | 850 | } |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | */ |
263 | 263 | public function __toString() |
264 | 264 | { |
265 | - return self::class . '@' . spl_object_id($this); |
|
265 | + return self::class.'@'.spl_object_id($this); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | // Restore ReflectionClass and properties |
350 | 350 | $this->reflectionClass = $reflectionService->getClass($this->className); |
351 | 351 | |
352 | - if (! $this->reflectionClass) { |
|
352 | + if ( ! $this->reflectionClass) { |
|
353 | 353 | return; |
354 | 354 | } |
355 | 355 | |
@@ -373,11 +373,11 @@ discard block |
||
373 | 373 | } |
374 | 374 | |
375 | 375 | // Verify & complete identifier mapping |
376 | - if (! $this->identifier) { |
|
376 | + if ( ! $this->identifier) { |
|
377 | 377 | throw MappingException::identifierRequired($this->className); |
378 | 378 | } |
379 | 379 | |
380 | - $explicitlyGeneratedProperties = array_filter($this->declaredProperties, static function (Property $property) : bool { |
|
380 | + $explicitlyGeneratedProperties = array_filter($this->declaredProperties, static function(Property $property) : bool { |
|
381 | 381 | return $property instanceof FieldMetadata |
382 | 382 | && $property->isPrimaryKey() |
383 | 383 | && $property->hasValueGenerator(); |
@@ -396,14 +396,14 @@ discard block |
||
396 | 396 | public function validateAssociations() : void |
397 | 397 | { |
398 | 398 | array_map( |
399 | - function (Property $property) { |
|
400 | - if (! ($property instanceof AssociationMetadata)) { |
|
399 | + function(Property $property) { |
|
400 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
401 | 401 | return; |
402 | 402 | } |
403 | 403 | |
404 | 404 | $targetEntity = $property->getTargetEntity(); |
405 | 405 | |
406 | - if (! class_exists($targetEntity)) { |
|
406 | + if ( ! class_exists($targetEntity)) { |
|
407 | 407 | throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName()); |
408 | 408 | } |
409 | 409 | }, |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | foreach ($this->lifecycleCallbacks as $callbacks) { |
422 | 422 | /** @var array $callbacks */ |
423 | 423 | foreach ($callbacks as $callbackFuncName) { |
424 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
424 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
425 | 425 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
426 | 426 | } |
427 | 427 | } |
@@ -445,11 +445,11 @@ discard block |
||
445 | 445 | */ |
446 | 446 | public function isIdentifier(string $fieldName) : bool |
447 | 447 | { |
448 | - if (! $this->identifier) { |
|
448 | + if ( ! $this->identifier) { |
|
449 | 449 | return false; |
450 | 450 | } |
451 | 451 | |
452 | - if (! $this->isIdentifierComposite()) { |
|
452 | + if ( ! $this->isIdentifierComposite()) { |
|
453 | 453 | return $fieldName === $this->identifier[0]; |
454 | 454 | } |
455 | 455 | |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | $property->setColumnName($columnName); |
478 | 478 | } |
479 | 479 | |
480 | - if (! $this->isMappedSuperclass) { |
|
480 | + if ( ! $this->isMappedSuperclass) { |
|
481 | 481 | $property->setTableName($this->getTableName()); |
482 | 482 | } |
483 | 483 | |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($this->className, $property); |
498 | 498 | } |
499 | 499 | |
500 | - if (! in_array($fieldName, $this->identifier, true)) { |
|
500 | + if ( ! in_array($fieldName, $this->identifier, true)) { |
|
501 | 501 | $this->identifier[] = $fieldName; |
502 | 502 | } |
503 | 503 | } |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $fieldName = $property->getName(); |
548 | 548 | $targetEntity = $property->getTargetEntity(); |
549 | 549 | |
550 | - if (! $targetEntity) { |
|
550 | + if ( ! $targetEntity) { |
|
551 | 551 | throw MappingException::missingTargetEntity($fieldName); |
552 | 552 | } |
553 | 553 | |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | throw MappingException::illegalOrphanRemovalOnIdentifierAssociation($this->className, $fieldName); |
561 | 561 | } |
562 | 562 | |
563 | - if (! in_array($property->getName(), $this->identifier, true)) { |
|
563 | + if ( ! in_array($property->getName(), $this->identifier, true)) { |
|
564 | 564 | if ($property instanceof ToOneAssociationMetadata && count($property->getJoinColumns()) >= 2) { |
565 | 565 | throw MappingException::cannotMapCompositePrimaryKeyEntitiesAsForeignId( |
566 | 566 | $property->getTargetEntity(), |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | /** @var JoinColumnMetadata $joinColumn */ |
623 | 623 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
624 | 624 | if (count($property->getJoinColumns()) === 1) { |
625 | - if (! $property->isPrimaryKey()) { |
|
625 | + if ( ! $property->isPrimaryKey()) { |
|
626 | 626 | $joinColumn->setUnique(true); |
627 | 627 | } |
628 | 628 | } else { |
@@ -630,13 +630,13 @@ discard block |
||
630 | 630 | } |
631 | 631 | } |
632 | 632 | |
633 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
633 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
634 | 634 | |
635 | - if (! $joinColumn->getColumnName()) { |
|
635 | + if ( ! $joinColumn->getColumnName()) { |
|
636 | 636 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className)); |
637 | 637 | } |
638 | 638 | |
639 | - if (! $joinColumn->getReferencedColumnName()) { |
|
639 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
640 | 640 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
641 | 641 | } |
642 | 642 | |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | } |
645 | 645 | |
646 | 646 | if ($uniqueConstraintColumns) { |
647 | - if (! $this->table) { |
|
647 | + if ( ! $this->table) { |
|
648 | 648 | throw new RuntimeException( |
649 | 649 | 'ClassMetadata::setTable() has to be called before defining a one to one relationship.' |
650 | 650 | ); |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | if ($property->isOrphanRemoval()) { |
665 | 665 | $cascades = $property->getCascade(); |
666 | 666 | |
667 | - if (! in_array('remove', $cascades, true)) { |
|
667 | + if ( ! in_array('remove', $cascades, true)) { |
|
668 | 668 | $cascades[] = 'remove'; |
669 | 669 | |
670 | 670 | $property->setCascade($cascades); |
@@ -727,14 +727,14 @@ discard block |
||
727 | 727 | protected function validateAndCompleteOneToManyMapping(OneToManyAssociationMetadata $property) |
728 | 728 | { |
729 | 729 | // OneToMany MUST have mappedBy |
730 | - if (! $property->getMappedBy()) { |
|
730 | + if ( ! $property->getMappedBy()) { |
|
731 | 731 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
732 | 732 | } |
733 | 733 | |
734 | 734 | if ($property->isOrphanRemoval()) { |
735 | 735 | $cascades = $property->getCascade(); |
736 | 736 | |
737 | - if (! in_array('remove', $cascades, true)) { |
|
737 | + if ( ! in_array('remove', $cascades, true)) { |
|
738 | 738 | $cascades[] = 'remove'; |
739 | 739 | |
740 | 740 | $property->setCascade($cascades); |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | |
758 | 758 | $property->setJoinTable($joinTable); |
759 | 759 | |
760 | - if (! $joinTable->getName()) { |
|
760 | + if ( ! $joinTable->getName()) { |
|
761 | 761 | $joinTableName = $this->namingStrategy->joinTableName( |
762 | 762 | $property->getSourceEntity(), |
763 | 763 | $property->getTargetEntity(), |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | |
770 | 770 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() === $property->getTargetEntity() && ! $joinTable->hasColumns(); |
771 | 771 | |
772 | - if (! $joinTable->getJoinColumns()) { |
|
772 | + if ( ! $joinTable->getJoinColumns()) { |
|
773 | 773 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
774 | 774 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
775 | 775 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -782,7 +782,7 @@ discard block |
||
782 | 782 | $joinTable->addJoinColumn($joinColumn); |
783 | 783 | } |
784 | 784 | |
785 | - if (! $joinTable->getInverseJoinColumns()) { |
|
785 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
786 | 786 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
787 | 787 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
788 | 788 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -797,13 +797,13 @@ discard block |
||
797 | 797 | |
798 | 798 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
799 | 799 | /** @var JoinColumnMetadata $joinColumn */ |
800 | - if (! $joinColumn->getReferencedColumnName()) { |
|
800 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
801 | 801 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
802 | 802 | } |
803 | 803 | |
804 | 804 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
805 | 805 | |
806 | - if (! $joinColumn->getColumnName()) { |
|
806 | + if ( ! $joinColumn->getColumnName()) { |
|
807 | 807 | $columnName = $this->namingStrategy->joinKeyColumnName( |
808 | 808 | $property->getSourceEntity(), |
809 | 809 | $referencedColumnName |
@@ -815,13 +815,13 @@ discard block |
||
815 | 815 | |
816 | 816 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
817 | 817 | /** @var JoinColumnMetadata $inverseJoinColumn */ |
818 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
818 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
819 | 819 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
820 | 820 | } |
821 | 821 | |
822 | 822 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
823 | 823 | |
824 | - if (! $inverseJoinColumn->getColumnName()) { |
|
824 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
825 | 825 | $columnName = $this->namingStrategy->joinKeyColumnName( |
826 | 826 | $property->getTargetEntity(), |
827 | 827 | $referencedColumnName |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className); |
856 | 856 | } |
857 | 857 | |
858 | - if (! isset($this->identifier[0])) { |
|
858 | + if ( ! isset($this->identifier[0])) { |
|
859 | 859 | throw MappingException::noIdDefined($this->className); |
860 | 860 | } |
861 | 861 | |
@@ -914,7 +914,7 @@ discard block |
||
914 | 914 | // Association defined as Id field |
915 | 915 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
916 | 916 | |
917 | - if (! $property->isOwningSide()) { |
|
917 | + if ( ! $property->isOwningSide()) { |
|
918 | 918 | $property = $targetClass->getProperty($property->getMappedBy()); |
919 | 919 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
920 | 920 | } |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | $columnName = $joinColumn->getColumnName(); |
929 | 929 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
930 | 930 | |
931 | - if (! $joinColumn->getType()) { |
|
931 | + if ( ! $joinColumn->getType()) { |
|
932 | 932 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
933 | 933 | } |
934 | 934 | |
@@ -962,10 +962,10 @@ discard block |
||
962 | 962 | { |
963 | 963 | $schema = $this->getSchemaName() === null |
964 | 964 | ? '' |
965 | - : $this->getSchemaName() . '_'; |
|
965 | + : $this->getSchemaName().'_'; |
|
966 | 966 | |
967 | 967 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
968 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
968 | + return $schema.$this->getTableName().'_id_tmp'; |
|
969 | 969 | } |
970 | 970 | |
971 | 971 | /** |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | */ |
1000 | 1000 | public function setInheritanceType($type) : void |
1001 | 1001 | { |
1002 | - if (! $this->isInheritanceType($type)) { |
|
1002 | + if ( ! $this->isInheritanceType($type)) { |
|
1003 | 1003 | throw MappingException::invalidInheritanceType($this->className, $type); |
1004 | 1004 | } |
1005 | 1005 | |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | { |
1018 | 1018 | $fieldName = $property->getName(); |
1019 | 1019 | |
1020 | - if (! isset($this->declaredProperties[$fieldName])) { |
|
1020 | + if ( ! isset($this->declaredProperties[$fieldName])) { |
|
1021 | 1021 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
1022 | 1022 | } |
1023 | 1023 | |
@@ -1214,7 +1214,7 @@ discard block |
||
1214 | 1214 | $declaringClass = $property->getDeclaringClass(); |
1215 | 1215 | |
1216 | 1216 | if ($inheritedProperty instanceof FieldMetadata) { |
1217 | - if (! $declaringClass->isMappedSuperclass) { |
|
1217 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
1218 | 1218 | $inheritedProperty->setTableName($property->getTableName()); |
1219 | 1219 | } |
1220 | 1220 | |
@@ -1325,11 +1325,11 @@ discard block |
||
1325 | 1325 | 'method' => $method, |
1326 | 1326 | ]; |
1327 | 1327 | |
1328 | - if (! class_exists($class)) { |
|
1328 | + if ( ! class_exists($class)) { |
|
1329 | 1329 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
1330 | 1330 | } |
1331 | 1331 | |
1332 | - if (! method_exists($class, $method)) { |
|
1332 | + if ( ! method_exists($class, $method)) { |
|
1333 | 1333 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->className); |
1334 | 1334 | } |
1335 | 1335 | |
@@ -1396,7 +1396,7 @@ discard block |
||
1396 | 1396 | return; |
1397 | 1397 | } |
1398 | 1398 | |
1399 | - if (! (class_exists($className) || interface_exists($className))) { |
|
1399 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
1400 | 1400 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
1401 | 1401 | } |
1402 | 1402 |
@@ -74,13 +74,13 @@ |
||
74 | 74 | |
75 | 75 | switch ($expr->getType()) { |
76 | 76 | case CompositeExpression::TYPE_AND: |
77 | - return '(' . implode(' AND ', $expressionList) . ')'; |
|
77 | + return '('.implode(' AND ', $expressionList).')'; |
|
78 | 78 | |
79 | 79 | case CompositeExpression::TYPE_OR: |
80 | - return '(' . implode(' OR ', $expressionList) . ')'; |
|
80 | + return '('.implode(' OR ', $expressionList).')'; |
|
81 | 81 | |
82 | 82 | default: |
83 | - throw new RuntimeException('Unknown composite ' . $expr->getType()); |
|
83 | + throw new RuntimeException('Unknown composite '.$expr->getType()); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 |