@@ -63,7 +63,7 @@ |
||
63 | 63 | 'u__status' => 'developer', |
64 | 64 | 'u__username' => 'jwage', |
65 | 65 | 'u__name' => 'Jonathan', |
66 | - 'sclr0' => 'JWAGE' . $i, |
|
66 | + 'sclr0' => 'JWAGE'.$i, |
|
67 | 67 | 'p__phonenumber' => '91', |
68 | 68 | ]; |
69 | 69 | } |
@@ -61,7 +61,7 @@ |
||
61 | 61 | $isInitialized = $collection->isInitialized(); |
62 | 62 | $isDirty = $collection->isDirty(); |
63 | 63 | |
64 | - if (! $isInitialized && ! $isDirty) { |
|
64 | + if ( ! $isInitialized && ! $isDirty) { |
|
65 | 65 | return; |
66 | 66 | } |
67 | 67 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | protected function prepare() |
55 | 55 | { |
56 | - if (! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) { |
|
56 | + if ( ! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) { |
|
57 | 57 | $this->hints[UnitOfWork::HINT_DEFEREAGERLOAD] = true; |
58 | 58 | } |
59 | 59 | |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | |
64 | 64 | // Remember which associations are "fetch joined", so that we know where to inject |
65 | 65 | // collection stubs or proxies and where not. |
66 | - if (! isset($this->rsm->relationMap[$dqlAlias])) { |
|
66 | + if ( ! isset($this->rsm->relationMap[$dqlAlias])) { |
|
67 | 67 | continue; |
68 | 68 | } |
69 | 69 | |
70 | 70 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
71 | 71 | |
72 | - if (! isset($this->rsm->aliasMap[$parent])) { |
|
72 | + if ( ! isset($this->rsm->aliasMap[$parent])) { |
|
73 | 73 | throw HydrationException::parentObjectOfRelationNotFound($dqlAlias, $parent); |
74 | 74 | } |
75 | 75 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $class = $this->getClassMetadata($className); |
96 | 96 | $inverseAssoc = $class->getProperty($association->getInversedBy()); |
97 | 97 | |
98 | - if (! ($inverseAssoc instanceof ToOneAssociationMetadata)) { |
|
98 | + if ( ! ($inverseAssoc instanceof ToOneAssociationMetadata)) { |
|
99 | 99 | continue; |
100 | 100 | } |
101 | 101 | |
@@ -161,14 +161,14 @@ discard block |
||
161 | 161 | $value = $association->getValue($entity); |
162 | 162 | $oid = spl_object_id($entity); |
163 | 163 | |
164 | - if (! $value instanceof PersistentCollection) { |
|
164 | + if ( ! $value instanceof PersistentCollection) { |
|
165 | 165 | $value = $association->wrap($entity, $value, $this->em); |
166 | 166 | |
167 | 167 | $association->setValue($entity, $value); |
168 | 168 | |
169 | 169 | $this->uow->setOriginalEntityProperty($oid, $fieldName, $value); |
170 | 170 | |
171 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
171 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
172 | 172 | } elseif (isset($this->hints[Query::HINT_REFRESH]) || |
173 | 173 | (isset($this->hints['fetched'][$parentDqlAlias][$fieldName]) && ! $value->isInitialized()) |
174 | 174 | ) { |
@@ -177,10 +177,10 @@ discard block |
||
177 | 177 | $value->setInitialized(true); |
178 | 178 | $value->unwrap()->clear(); |
179 | 179 | |
180 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
180 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
181 | 181 | } else { |
182 | 182 | // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN! |
183 | - $this->existingCollections[$oid . $fieldName] = $value; |
|
183 | + $this->existingCollections[$oid.$fieldName] = $value; |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | return $value; |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | if (isset($this->rsm->discriminatorColumns[$dqlAlias])) { |
204 | 204 | $fieldName = $this->rsm->discriminatorColumns[$dqlAlias]; |
205 | 205 | |
206 | - if (! isset($this->rsm->metaMappings[$fieldName])) { |
|
206 | + if ( ! isset($this->rsm->metaMappings[$fieldName])) { |
|
207 | 207 | throw HydrationException::missingDiscriminatorMetaMappingColumn($className, $fieldName, $dqlAlias); |
208 | 208 | } |
209 | 209 | |
210 | 210 | $discrColumn = $this->rsm->metaMappings[$fieldName]; |
211 | 211 | |
212 | - if (! isset($data[$discrColumn])) { |
|
212 | + if ( ! isset($data[$discrColumn])) { |
|
213 | 213 | throw HydrationException::missingDiscriminatorColumn($className, $discrColumn, $dqlAlias); |
214 | 214 | } |
215 | 215 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $discrMap = $this->metadataCache[$className]->discriminatorMap; |
221 | 221 | $discriminatorValue = (string) $data[$discrColumn]; |
222 | 222 | |
223 | - if (! isset($discrMap[$discriminatorValue])) { |
|
223 | + if ( ! isset($discrMap[$discriminatorValue])) { |
|
224 | 224 | throw HydrationException::invalidDiscriminatorValue($discriminatorValue, array_keys($discrMap)); |
225 | 225 | } |
226 | 226 | |
@@ -296,10 +296,10 @@ discard block |
||
296 | 296 | $parentAlias = $this->rsm->parentAliasMap[$dqlAlias]; |
297 | 297 | // we need the $path to save into the identifier map which entities were already |
298 | 298 | // seen for this parent-child relationship |
299 | - $path = $parentAlias . '.' . $dqlAlias; |
|
299 | + $path = $parentAlias.'.'.$dqlAlias; |
|
300 | 300 | |
301 | 301 | // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs |
302 | - if (! isset($nonemptyComponents[$parentAlias])) { |
|
302 | + if ( ! isset($nonemptyComponents[$parentAlias])) { |
|
303 | 303 | // TODO: Add special case code where we hydrate the right join objects into identity map at least |
304 | 304 | continue; |
305 | 305 | } |
@@ -330,15 +330,15 @@ discard block |
||
330 | 330 | $oid = spl_object_id($parentObject); |
331 | 331 | |
332 | 332 | // Check the type of the relation (many or single-valued) |
333 | - if (! ($association instanceof ToOneAssociationMetadata)) { |
|
333 | + if ( ! ($association instanceof ToOneAssociationMetadata)) { |
|
334 | 334 | // PATH A: Collection-valued association |
335 | 335 | $reflFieldValue = $association->getValue($parentObject); |
336 | 336 | |
337 | 337 | if (isset($nonemptyComponents[$dqlAlias])) { |
338 | - $collKey = $oid . $relationField; |
|
338 | + $collKey = $oid.$relationField; |
|
339 | 339 | if (isset($this->initializedCollections[$collKey])) { |
340 | 340 | $reflFieldValue = $this->initializedCollections[$collKey]; |
341 | - } elseif (! isset($this->existingCollections[$collKey])) { |
|
341 | + } elseif ( ! isset($this->existingCollections[$collKey])) { |
|
342 | 342 | $reflFieldValue = $this->initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias); |
343 | 343 | } |
344 | 344 | |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | $index = $indexExists ? $this->identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] : false; |
347 | 347 | $indexIsValid = $index !== false ? isset($reflFieldValue[$index]) : false; |
348 | 348 | |
349 | - if (! $indexExists || ! $indexIsValid) { |
|
349 | + if ( ! $indexExists || ! $indexIsValid) { |
|
350 | 350 | if (isset($this->existingCollections[$collKey])) { |
351 | 351 | $element = $this->getEntityFromIdentityMap($entityName, $data); |
352 | 352 | |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | // Update result pointer |
376 | 376 | $this->resultPointers[$dqlAlias] = $reflFieldValue[$index]; |
377 | 377 | } |
378 | - } elseif (! $reflFieldValue) { |
|
378 | + } elseif ( ! $reflFieldValue) { |
|
379 | 379 | $reflFieldValue = $this->initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias); |
380 | 380 | } elseif ($reflFieldValue instanceof PersistentCollection && $reflFieldValue->isInitialized() === false) { |
381 | 381 | $reflFieldValue->setInitialized(true); |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | // PATH B: Single-valued association |
385 | 385 | $reflFieldValue = $association->getValue($parentObject); |
386 | 386 | |
387 | - if (! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) || |
|
387 | + if ( ! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) || |
|
388 | 388 | ($reflFieldValue instanceof GhostObjectInterface && ! $reflFieldValue->isProxyInitialized())) { |
389 | 389 | // we only need to take action if this value is null, |
390 | 390 | // we refresh the entity or its an uninitialized proxy. |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
446 | 446 | |
447 | 447 | // if this row has a NULL value for the root result id then make it a null result. |
448 | - if (! isset($nonemptyComponents[$dqlAlias])) { |
|
448 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
449 | 449 | if ($this->rsm->isMixed) { |
450 | 450 | $result[] = [$entityKey => null]; |
451 | 451 | } else { |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | } |
458 | 458 | |
459 | 459 | // check for existing result from the iterations before |
460 | - if (! isset($this->identifierMap[$dqlAlias][$id[$dqlAlias]])) { |
|
460 | + if ( ! isset($this->identifierMap[$dqlAlias][$id[$dqlAlias]])) { |
|
461 | 461 | $element = $this->getEntity($data, $dqlAlias); |
462 | 462 | |
463 | 463 | if ($this->rsm->isMixed) { |
@@ -500,13 +500,13 @@ discard block |
||
500 | 500 | } |
501 | 501 | } |
502 | 502 | |
503 | - if (! isset($resultKey)) { |
|
503 | + if ( ! isset($resultKey)) { |
|
504 | 504 | $this->resultCounter++; |
505 | 505 | } |
506 | 506 | |
507 | 507 | // Append scalar values to mixed result sets |
508 | 508 | if (isset($rowData['scalars'])) { |
509 | - if (! isset($resultKey)) { |
|
509 | + if ( ! isset($resultKey)) { |
|
510 | 510 | $resultKey = isset($this->rsm->indexByMap['scalars']) |
511 | 511 | ? $row[$this->rsm->indexByMap['scalars']] |
512 | 512 | : $this->resultCounter - 1; |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | |
520 | 520 | // Append new object to mixed result sets |
521 | 521 | if (isset($rowData['newObjects'])) { |
522 | - if (! isset($resultKey)) { |
|
522 | + if ( ! isset($resultKey)) { |
|
523 | 523 | $resultKey = $this->resultCounter - 1; |
524 | 524 | } |
525 | 525 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $this->addToAssertionCount(1); |
30 | 30 | } catch (QueryException $e) { |
31 | 31 | if ($debug) { |
32 | - echo $e->getTraceAsString() . PHP_EOL; |
|
32 | + echo $e->getTraceAsString().PHP_EOL; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | $this->fail($e->getMessage()); |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | $this->fail('No syntax errors were detected, when syntax errors were expected'); |
45 | 45 | } catch (QueryException $e) { |
46 | 46 | if ($debug) { |
47 | - echo $e->getMessage() . PHP_EOL; |
|
48 | - echo $e->getTraceAsString() . PHP_EOL; |
|
47 | + echo $e->getMessage().PHP_EOL; |
|
48 | + echo $e->getTraceAsString().PHP_EOL; |
|
49 | 49 | } |
50 | 50 | $this->addToAssertionCount(1); |
51 | 51 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | ['SELECT foo: FROM Doctrine\Tests\Models\CMS\CmsUser foo:'], |
108 | 108 | |
109 | 109 | /* Checks for invalid AbstractSchemaName */ |
110 | - ['SELECT u FROM UnknownClass u'], // unknown |
|
110 | + ['SELECT u FROM UnknownClass u'], // unknown |
|
111 | 111 | ['SELECT u FROM \Unknown\Class u'], // unknown, leading backslash |
112 | 112 | ['SELECT u FROM Unknown\\\\Class u'], // unknown, syntactically bogus (duplicate \\) |
113 | 113 | ['SELECT u FROM Unknown\Class\ u'], // unknown, syntactically bogus (trailing \) |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | */ |
574 | 574 | public function testDQLKeywordInJoinIsAllowed() : void |
575 | 575 | { |
576 | - self::assertValidDQL('SELECT u FROM ' . __NAMESPACE__ . '\DQLKeywordsModelUser u JOIN u.group g'); |
|
576 | + self::assertValidDQL('SELECT u FROM '.__NAMESPACE__.'\DQLKeywordsModelUser u JOIN u.group g'); |
|
577 | 577 | } |
578 | 578 | |
579 | 579 | /** |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | */ |
582 | 582 | public function testDQLKeywordInConditionIsAllowed() : void |
583 | 583 | { |
584 | - self::assertValidDQL('SELECT g FROM ' . __NAMESPACE__ . '\DQLKeywordsModelGroup g WHERE g.from=0'); |
|
584 | + self::assertValidDQL('SELECT g FROM '.__NAMESPACE__.'\DQLKeywordsModelGroup g WHERE g.from=0'); |
|
585 | 585 | } |
586 | 586 | |
587 | 587 | /* The exception is currently thrown in the SQLWalker, not earlier. |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | */ |
687 | 687 | public function testNewLiteralExpression() : void |
688 | 688 | { |
689 | - self::assertValidDQL('SELECT new ' . __NAMESPACE__ . "\\DummyStruct(u.id, 'foo', 1, true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
689 | + self::assertValidDQL('SELECT new '.__NAMESPACE__."\\DummyStruct(u.id, 'foo', 1, true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
690 | 690 | } |
691 | 691 | |
692 | 692 | /** |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | */ |
695 | 695 | public function testNewLiteralWithSubselectExpression() : void |
696 | 696 | { |
697 | - self::assertValidDQL('SELECT new ' . __NAMESPACE__ . "\\DummyStruct(u.id, 'foo', (SELECT 1 FROM Doctrine\Tests\Models\CMS\CmsUser su), true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
697 | + self::assertValidDQL('SELECT new '.__NAMESPACE__."\\DummyStruct(u.id, 'foo', (SELECT 1 FROM Doctrine\Tests\Models\CMS\CmsUser su), true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
698 | 698 | } |
699 | 699 | |
700 | 700 | public function testStringPrimaryAcceptsAggregateExpression() : void |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | { |
40 | 40 | $query = $this->em->createQuery( |
41 | 41 | 'SELECT CONCAT(e.type, MIN(e.version)) pair' |
42 | - . ' FROM ' . GH7286Entity::class . ' e' |
|
42 | + . ' FROM '.GH7286Entity::class.' e' |
|
43 | 43 | . ' WHERE e.type IS NOT NULL' |
44 | 44 | . ' GROUP BY e.type' |
45 | 45 | . ' ORDER BY e.type' |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | $query = $this->em->createQuery( |
65 | 65 | 'SELECT CC(e.type, MIN(e.version)) pair' |
66 | - . ' FROM ' . GH7286Entity::class . ' e' |
|
66 | + . ' FROM '.GH7286Entity::class.' e' |
|
67 | 67 | . ' WHERE e.type IS NOT NULL AND e.type != :type' |
68 | 68 | . ' GROUP BY e.type' |
69 | 69 | ); |
@@ -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 | } |