Passed
Pull Request — master (#7448)
by Ilya
14:31
created
lib/Doctrine/ORM/PersistentCollection.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
         //       association (table). Without initializing the collection.
331 331
         $removed = parent::remove($key);
332 332
 
333
-        if (! $removed) {
333
+        if ( ! $removed) {
334 334
             return $removed;
335 335
         }
336 336
 
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
      */
352 352
     public function removeElement($element)
353 353
     {
354
-        if (! $this->initialized &&
354
+        if ( ! $this->initialized &&
355 355
             $this->association !== null &&
356 356
             $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) {
357 357
             if ($this->collection->contains($element)) {
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 
366 366
         $removed = parent::removeElement($element);
367 367
 
368
-        if (! $removed) {
368
+        if ( ! $removed) {
369 369
             return $removed;
370 370
         }
371 371
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
      */
387 387
     public function containsKey($key)
388 388
     {
389
-        if (! $this->initialized &&
389
+        if ( ! $this->initialized &&
390 390
             $this->association !== null &&
391 391
             $this->association->getFetchMode() === FetchMode::EXTRA_LAZY &&
392 392
             $this->association->getIndexedBy()) {
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
      */
404 404
     public function contains($element)
405 405
     {
406
-        if (! $this->initialized &&
406
+        if ( ! $this->initialized &&
407 407
             $this->association !== null &&
408 408
             $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) {
409 409
             $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association);
@@ -419,11 +419,11 @@  discard block
 block discarded – undo
419 419
      */
420 420
     public function get($key)
421 421
     {
422
-        if (! $this->initialized &&
422
+        if ( ! $this->initialized &&
423 423
             $this->association !== null &&
424 424
             $this->association->getFetchMode() === FetchMode::EXTRA_LAZY &&
425 425
             $this->association->getIndexedBy()) {
426
-            if (! $this->typeClass->isIdentifierComposite() && $this->typeClass->isIdentifier($this->association->getIndexedBy())) {
426
+            if ( ! $this->typeClass->isIdentifierComposite() && $this->typeClass->isIdentifier($this->association->getIndexedBy())) {
427 427
                 return $this->em->find($this->typeClass->getClassName(), $key);
428 428
             }
429 429
 
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
      */
439 439
     public function count()
440 440
     {
441
-        if (! $this->initialized &&
441
+        if ( ! $this->initialized &&
442 442
             $this->association !== null &&
443 443
             $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) {
444 444
             $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association);
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
      */
503 503
     public function offsetSet($offset, $value)
504 504
     {
505
-        if (! isset($offset)) {
505
+        if ( ! isset($offset)) {
506 506
             $this->add($value);
507 507
             return;
508 508
         }
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
      */
597 597
     public function slice($offset, $length = null)
598 598
     {
599
-        if (! $this->initialized &&
599
+        if ( ! $this->initialized &&
600 600
             ! $this->isDirty &&
601 601
             $this->association !== null &&
602 602
             $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/MatchingAssociationFieldRequiresObject.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     public static function fromClassAndAssociation(string $class, string $associationName) : self
13 13
     {
14 14
         return new self(sprintf(
15
-            'Cannot match on %s::%s with a non-object value. Matching objects by id is ' .
15
+            'Cannot match on %s::%s with a non-object value. Matching objects by id is '.
16 16
             'not compatible with matching on an in-memory collection, which compares objects by reference.',
17 17
             $class,
18 18
             $associationName
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/SingleTablePersister.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName);
46 46
         $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType);
47 47
 
48
-        $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias . '.' . $quotedColumnName, $this->platform);
48
+        $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias.'.'.$quotedColumnName, $this->platform);
49 49
 
50 50
         // Append subclass columns
51 51
         foreach ($this->class->getSubClasses() as $subClassName) {
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                             /** @var JoinColumnMetadata $joinColumn */
70 70
                             $referencedColumnName = $joinColumn->getReferencedColumnName();
71 71
 
72
-                            if (! $joinColumn->getType()) {
72
+                            if ( ! $joinColumn->getType()) {
73 73
                                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
74 74
                             }
75 75
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
             $conditionSql .= ' AND ';
124 124
         }
125 125
 
126
-        return $conditionSql . $this->getSelectConditionDiscriminatorValueSQL();
126
+        return $conditionSql.$this->getSelectConditionDiscriminatorValueSQL();
127 127
     }
128 128
 
129 129
     /**
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
             $conditionSql .= ' AND ';
138 138
         }
139 139
 
140
-        return $conditionSql . $this->getSelectConditionDiscriminatorValueSQL();
140
+        return $conditionSql.$this->getSelectConditionDiscriminatorValueSQL();
141 141
     }
142 142
 
143 143
     /**
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 
165 165
         return sprintf(
166 166
             '%s IN (%s)',
167
-            $discrColumnType->convertToDatabaseValueSQL($tableAlias . '.' . $quotedColumnName, $this->platform),
167
+            $discrColumnType->convertToDatabaseValueSQL($tableAlias.'.'.$quotedColumnName, $this->platform),
168 168
             implode(', ', $values)
169 169
         );
170 170
     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/AbstractEntityInheritancePersister.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,6 +56,6 @@
 block discarded – undo
56 56
             $columnType
57 57
         );
58 58
 
59
-        return $columnType->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias;
59
+        return $columnType->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias;
60 60
     }
61 61
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/SqlValueVisitor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,13 +79,13 @@
 block discarded – undo
79 79
 
80 80
         switch ($comparison->getOperator()) {
81 81
             case Comparison::CONTAINS:
82
-                return '%' . $value . '%';
82
+                return '%'.$value.'%';
83 83
 
84 84
             case Comparison::STARTS_WITH:
85
-                return $value . '%';
85
+                return $value.'%';
86 86
 
87 87
             case Comparison::ENDS_WITH:
88
-                return '%' . $value;
88
+                return '%'.$value;
89 89
 
90 90
             default:
91 91
                 return $value;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Exception/InvalidOrientation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,6 +10,6 @@
 block discarded – undo
10 10
 {
11 11
     public static function fromClassNameAndField(string $className, string $field) : self
12 12
     {
13
-        return new self('Invalid order by orientation specified for ' . $className . '#' . $field);
13
+        return new self('Invalid order by orientation specified for '.$className.'#'.$field);
14 14
     }
15 15
 }
Please login to merge, or discard this patch.
Performance/Hydration/MixedQueryFetchJoinArrayHydrationPerformanceBench.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
ORM/Cache/Persister/Collection/ReadWriteCachedCollectionPersister.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.