Passed
Pull Request — master (#7885)
by Šimon
05:58
created
lib/Doctrine/ORM/Cache/DefaultQueryCache.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -62,17 +62,17 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function get(QueryCacheKey $key, ResultSetMapping $rsm, array $hints = [])
64 64
     {
65
-        if (! ($key->cacheMode & Cache::MODE_GET)) {
65
+        if ( ! ($key->cacheMode & Cache::MODE_GET)) {
66 66
             return null;
67 67
         }
68 68
 
69 69
         $cacheEntry = $this->region->get($key);
70 70
 
71
-        if (! $cacheEntry instanceof QueryCacheEntry) {
71
+        if ( ! $cacheEntry instanceof QueryCacheEntry) {
72 72
             return null;
73 73
         }
74 74
 
75
-        if (! $this->validator->isValid($key, $cacheEntry)) {
75
+        if ( ! $this->validator->isValid($key, $cacheEntry)) {
76 76
             $this->region->evict($key);
77 77
 
78 78
             return null;
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
         $cm = $this->em->getClassMetadata($entityName);
90 90
 
91
-        $generateKeys = static function (array $entry) use ($cm) : EntityCacheKey {
91
+        $generateKeys = static function(array $entry) use ($cm) : EntityCacheKey {
92 92
             return new EntityCacheKey($cm->getRootClassName(), $entry['identifier']);
93 93
         };
94 94
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                 $this->cacheLogger->entityCacheHit($regionName, $cacheKeys->identifiers[$index]);
112 112
             }
113 113
 
114
-            if (! $hasRelation) {
114
+            if ( ! $hasRelation) {
115 115
                 $result[$index] = $unitOfWork->createEntity(
116 116
                     $entityEntry->class,
117 117
                     $entityEntry->resolveAssociationEntries($this->em),
@@ -156,11 +156,11 @@  discard block
 block discarded – undo
156 156
                     continue;
157 157
                 }
158 158
 
159
-                if (! isset($assoc['list']) || empty($assoc['list'])) {
159
+                if ( ! isset($assoc['list']) || empty($assoc['list'])) {
160 160
                     continue;
161 161
                 }
162 162
 
163
-                $generateKeys = static function ($id) use ($assocMetadata) : EntityCacheKey {
163
+                $generateKeys = static function($id) use ($assocMetadata) : EntityCacheKey {
164 164
                     return new EntityCacheKey($assocMetadata->getRootClassName(), $id);
165 165
                 };
166 166
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
             throw FeatureNotImplemented::multipleRootEntities();
240 240
         }
241 241
 
242
-        if (! $rsm->isSelect) {
242
+        if ( ! $rsm->isSelect) {
243 243
             throw FeatureNotImplemented::nonSelectStatements();
244 244
         }
245 245
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
             throw FeatureNotImplemented::partialEntities();
248 248
         }
249 249
 
250
-        if (! ($key->cacheMode & Cache::MODE_PUT)) {
250
+        if ( ! ($key->cacheMode & Cache::MODE_PUT)) {
251 251
             return false;
252 252
         }
253 253
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
         $unitOfWork = $this->em->getUnitOfWork();
258 258
         $persister  = $unitOfWork->getEntityPersister($entityName);
259 259
 
260
-        if (! ($persister instanceof CachedPersister)) {
260
+        if ( ! ($persister instanceof CachedPersister)) {
261 261
             throw NonCacheableEntity::fromEntity($entityName);
262 262
         }
263 263
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 
270 270
             if (($key->cacheMode & Cache::MODE_REFRESH) || ! $region->contains($entityKey)) {
271 271
                 // Cancel put result if entity put fail
272
-                if (! $persister->storeEntityCache($entity, $entityKey)) {
272
+                if ( ! $persister->storeEntityCache($entity, $entityKey)) {
273 273
                     return false;
274 274
                 }
275 275
             }
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
                 }
304 304
 
305 305
                 // store single nested association
306
-                if (! is_array($assocValue)) {
306
+                if ( ! is_array($assocValue)) {
307 307
                     // Cancel put result if association put fail
308 308
                     if ($this->storeAssociationCache($key, $association, $assocValue) === null) {
309 309
                         return false;
@@ -342,9 +342,9 @@  discard block
 block discarded – undo
342 342
             $assocIdentifier = $unitOfWork->getEntityIdentifier($assocValue);
343 343
             $entityKey       = new EntityCacheKey($assocMetadata->getRootClassName(), $assocIdentifier);
344 344
 
345
-            if ((! $assocValue instanceof GhostObjectInterface && ($key->cacheMode & Cache::MODE_REFRESH)) || ! $assocRegion->contains($entityKey)) {
345
+            if (( ! $assocValue instanceof GhostObjectInterface && ($key->cacheMode & Cache::MODE_REFRESH)) || ! $assocRegion->contains($entityKey)) {
346 346
                 // Entity put fail
347
-                if (! $assocPersister->storeEntityCache($assocValue, $entityKey)) {
347
+                if ( ! $assocPersister->storeEntityCache($assocValue, $entityKey)) {
348 348
                     return null;
349 349
                 }
350 350
             }
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 
365 365
             if (($key->cacheMode & Cache::MODE_REFRESH) || ! $assocRegion->contains($entityKey)) {
366 366
                 // Entity put fail
367
-                if (! $assocPersister->storeEntityCache($assocItem, $entityKey)) {
367
+                if ( ! $assocPersister->storeEntityCache($assocItem, $entityKey)) {
368 368
                     return null;
369 369
                 }
370 370
             }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/EntityCacheEntry.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@
 block discarded – undo
57 57
      */
58 58
     public function resolveAssociationEntries(EntityManagerInterface $em)
59 59
     {
60
-        return array_map(static function ($value) use ($em) {
61
-            if (! ($value instanceof AssociationCacheEntry)) {
60
+        return array_map(static function($value) use ($em) {
61
+            if ( ! ($value instanceof AssociationCacheEntry)) {
62 62
                 return $value;
63 63
             }
64 64
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/OrmPerformanceTestCase.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
      */
42 42
     public function setMaxRunningTime($maxRunningTime)
43 43
     {
44
-        if (! (is_int($maxRunningTime) && $maxRunningTime >= 0)) {
44
+        if ( ! (is_int($maxRunningTime) && $maxRunningTime >= 0)) {
45 45
             throw new InvalidArgumentException();
46 46
         }
47 47
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/SingleTableInheritanceTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 
234 234
         $contracts = $this->em->createQuery('SELECT c FROM Doctrine\Tests\Models\Company\CompanyContract c ORDER BY c.id')->getScalarResult();
235 235
 
236
-        $discrValues = array_map(static function ($a) {
236
+        $discrValues = array_map(static function($a) {
237 237
             return $a['c_discr'];
238 238
         }, $contracts);
239 239
 
@@ -335,19 +335,19 @@  discard block
 block discarded – undo
335 335
 
336 336
         $repos     = $this->em->getRepository(CompanyContract::class);
337 337
         $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]);
338
-        self::assertCount(3, $contracts, 'There should be 3 entities related to ' . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyContract'");
338
+        self::assertCount(3, $contracts, 'There should be 3 entities related to '.$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyContract'");
339 339
 
340 340
         $repos     = $this->em->getRepository(CompanyFixContract::class);
341 341
         $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]);
342
-        self::assertCount(1, $contracts, 'There should be 1 entities related to ' . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyFixContract'");
342
+        self::assertCount(1, $contracts, 'There should be 1 entities related to '.$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyFixContract'");
343 343
 
344 344
         $repos     = $this->em->getRepository(CompanyFlexContract::class);
345 345
         $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]);
346
-        self::assertCount(2, $contracts, 'There should be 2 entities related to ' . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyFlexContract'");
346
+        self::assertCount(2, $contracts, 'There should be 2 entities related to '.$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyFlexContract'");
347 347
 
348 348
         $repos     = $this->em->getRepository(CompanyFlexUltraContract::class);
349 349
         $contracts = $repos->findBy(['salesPerson' => $this->salesPerson->getId()]);
350
-        self::assertCount(1, $contracts, 'There should be 1 entities related to ' . $this->salesPerson->getId() . " for 'Doctrine\Tests\Models\Company\CompanyFlexUltraContract'");
350
+        self::assertCount(1, $contracts, 'There should be 1 entities related to '.$this->salesPerson->getId()." for 'Doctrine\Tests\Models\Company\CompanyFlexUltraContract'");
351 351
     }
352 352
 
353 353
     /**
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2602Test.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     {
138 138
         $entity = $event->getEntity();
139 139
 
140
-        if (! ($entity instanceof DDC2602Biography)) {
140
+        if ( ! ($entity instanceof DDC2602Biography)) {
141 141
             return;
142 142
         }
143 143
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             $fieldSelection = new DDC2602FieldSelection();
159 159
 
160 160
             $fieldSelection->field      = $field;
161
-            $fieldSelection->choiceList = $field->choiceList->filter(static function ($choice) use ($choiceList) {
161
+            $fieldSelection->choiceList = $field->choiceList->filter(static function($choice) use ($choiceList) {
162 162
                 return in_array($choice->id, $choiceList, true);
163 163
             });
164 164
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         $this->em->clear();
52 52
 
53 53
         $cart = $this->em
54
-            ->createQuery('select ca, c from ' . DDC522Cart::class . ' ca join ca.customer c')
54
+            ->createQuery('select ca, c from '.DDC522Cart::class.' ca join ca.customer c')
55 55
             ->getSingleResult();
56 56
 
57 57
         self::assertInstanceOf(DDC522Cart::class, $cart);
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2084Test.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
         try {
20 20
             $this->schemaTool->createSchema(
21 21
                 [
22
-                    $this->em->getClassMetadata(__NAMESPACE__ . '\DDC2084\MyEntity1'),
23
-                    $this->em->getClassMetadata(__NAMESPACE__ . '\DDC2084\MyEntity2'),
22
+                    $this->em->getClassMetadata(__NAMESPACE__.'\DDC2084\MyEntity1'),
23
+                    $this->em->getClassMetadata(__NAMESPACE__.'\DDC2084\MyEntity2'),
24 24
                 ]
25 25
             );
26 26
         } catch (Exception $exc) {
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
     {
48 48
         $e1 = $this->loadFixture();
49 49
         $e2 = $e1->getMyEntity2();
50
-        $e  = $this->em->find(__NAMESPACE__ . '\DDC2084\MyEntity1', $e2);
50
+        $e  = $this->em->find(__NAMESPACE__.'\DDC2084\MyEntity1', $e2);
51 51
 
52
-        self::assertInstanceOf(__NAMESPACE__ . '\DDC2084\MyEntity1', $e);
53
-        self::assertInstanceOf(__NAMESPACE__ . '\DDC2084\MyEntity2', $e->getMyEntity2());
52
+        self::assertInstanceOf(__NAMESPACE__.'\DDC2084\MyEntity1', $e);
53
+        self::assertInstanceOf(__NAMESPACE__.'\DDC2084\MyEntity2', $e->getMyEntity2());
54 54
         self::assertEquals('Foo', $e->getMyEntity2()->getValue());
55 55
     }
56 56
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function testinvalidIdentifierBindingEntityException() : void
62 62
     {
63
-        $this->em->find(__NAMESPACE__ . '\DDC2084\MyEntity1', new DDC2084\MyEntity2('Foo'));
63
+        $this->em->find(__NAMESPACE__.'\DDC2084\MyEntity1', new DDC2084\MyEntity2('Foo'));
64 64
     }
65 65
 }
66 66
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/GH6141Test.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function convertToDatabaseValue($value, AbstractPlatform $platform)
82 82
     {
83
-        if (! $value instanceof GH6141People) {
83
+        if ( ! $value instanceof GH6141People) {
84 84
             $value = GH6141People::get($value);
85 85
         }
86 86
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      */
122 122
     public static function get($value)
123 123
     {
124
-        if (! self::isValid($value)) {
124
+        if ( ! self::isValid($value)) {
125 125
             throw new InvalidArgumentException();
126 126
         }
127 127
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3123Test.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@
 block discarded – undo
33 33
         $uow->scheduleExtraUpdate($user, ['name' => 'changed name']);
34 34
 
35 35
         $listener = $this->getMockBuilder(stdClass::class)
36
-                         ->setMethods([Events::postFlush])
37
-                         ->getMock();
36
+                            ->setMethods([Events::postFlush])
37
+                            ->getMock();
38 38
 
39 39
         $listener
40 40
             ->expects($this->once())
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         $listener
39 39
             ->expects($this->once())
40 40
             ->method(Events::postFlush)
41
-            ->will($this->returnCallback(static function () use ($uow) {
41
+            ->will($this->returnCallback(static function() use ($uow) {
42 42
                 self::assertAttributeEmpty('extraUpdates', $uow, 'ExtraUpdates are reset before postFlush');
43 43
             }));
44 44
 
Please login to merge, or discard this patch.