Failed Conditions
Push — master ( 8be1e3...e3936d )
by Marco
14s
created
lib/Doctrine/ORM/Cache/DefaultQueryCache.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Cache;
6 6
 
@@ -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 = function (array $entry) use ($cm) : EntityCacheKey {
91
+        $generateKeys = 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 = function ($id) use ($assocMetadata) : EntityCacheKey {
163
+                $generateKeys = function($id) use ($assocMetadata) : EntityCacheKey {
164 164
                     return new EntityCacheKey($assocMetadata->getRootClassName(), $id);
165 165
                 };
166 166
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
             throw new CacheException('Second level cache does not support multiple root entities.');
239 239
         }
240 240
 
241
-        if (! $rsm->isSelect) {
241
+        if ( ! $rsm->isSelect) {
242 242
             throw new CacheException('Second-level cache query supports only select statements.');
243 243
         }
244 244
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
             throw new CacheException('Second level cache does not support partial entities.');
247 247
         }
248 248
 
249
-        if (! ($key->cacheMode & Cache::MODE_PUT)) {
249
+        if ( ! ($key->cacheMode & Cache::MODE_PUT)) {
250 250
             return false;
251 251
         }
252 252
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         $unitOfWork = $this->em->getUnitOfWork();
257 257
         $persister  = $unitOfWork->getEntityPersister($entityName);
258 258
 
259
-        if (! ($persister instanceof CachedPersister)) {
259
+        if ( ! ($persister instanceof CachedPersister)) {
260 260
             throw CacheException::nonCacheableEntity($entityName);
261 261
         }
262 262
 
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 
269 269
             if (($key->cacheMode & Cache::MODE_REFRESH) || ! $region->contains($entityKey)) {
270 270
                 // Cancel put result if entity put fail
271
-                if (! $persister->storeEntityCache($entity, $entityKey)) {
271
+                if ( ! $persister->storeEntityCache($entity, $entityKey)) {
272 272
                     return false;
273 273
                 }
274 274
             }
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
                 }
303 303
 
304 304
                 // store single nested association
305
-                if (! is_array($assocValue)) {
305
+                if ( ! is_array($assocValue)) {
306 306
                     // Cancel put result if association put fail
307 307
                     if ($this->storeAssociationCache($key, $association, $assocValue) === null) {
308 308
                         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/Proxy/Factory/StaticProxyFactory.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Proxy\Factory;
6 6
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function generateProxyClasses(array $classes) : int
63 63
     {
64
-        $concreteClasses = \array_filter($classes, function (ClassMetadata $metadata) : bool {
64
+        $concreteClasses = \array_filter($classes, function(ClassMetadata $metadata) : bool {
65 65
             return ! ($metadata->isMappedSuperclass || $metadata->getReflectionClass()->isAbstract());
66 66
         });
67 67
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                 ->proxyFactory
71 71
                 ->createProxy(
72 72
                     $metadata->getClassName(),
73
-                    function () {
73
+                    function() {
74 74
                         // empty closure, serves its purpose, for now
75 75
                     },
76 76
                     $this->skippedFieldsFqns($metadata)
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                 ->getUnitOfWork()
95 95
                 ->getEntityPersister($metadata->getClassName());
96 96
 
97
-        $proxyInstance                                            = $this
97
+        $proxyInstance = $this
98 98
             ->proxyFactory
99 99
             ->createProxy(
100 100
                 $metadata->getClassName(),
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
     private function makeInitializer(ClassMetadata $metadata, EntityPersister $persister) : \Closure
115 115
     {
116
-        return function (
116
+        return function(
117 117
             GhostObjectInterface $ghostObject,
118 118
             string $method,
119 119
             // we don't care
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             $identifier = $persister->getIdentifier($ghostObject);
132 132
 
133 133
             // @TODO how do we use `$properties` in the persister? That would be a massive optimisation
134
-            if (! $persister->loadById($identifier, $ghostObject)) {
134
+            if ( ! $persister->loadById($identifier, $ghostObject)) {
135 135
                 $initializer = $originalInitializer;
136 136
 
137 137
                 throw EntityNotFoundException::fromClassNameAndIdentifier(
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         $transientFieldsFqns = [];
164 164
 
165 165
         foreach ($metadata->getDeclaredPropertiesIterator() as $name => $property) {
166
-            if (! $property instanceof TransientMetadata) {
166
+            if ( ! $property instanceof TransientMetadata) {
167 167
                 continue;
168 168
             }
169 169
 
@@ -201,11 +201,11 @@  discard block
 block discarded – undo
201 201
     private function propertyFqcn(\ReflectionProperty $property) : string
202 202
     {
203 203
         if ($property->isPrivate()) {
204
-            return "\0" . $property->getDeclaringClass()->getName() . "\0" . $property->getName();
204
+            return "\0".$property->getDeclaringClass()->getName()."\0".$property->getName();
205 205
         }
206 206
 
207 207
         if ($property->isProtected()) {
208
-            return "\0*\0" . $property->getName();
208
+            return "\0*\0".$property->getName();
209 209
         }
210 210
 
211 211
         return $property->getName();
Please login to merge, or discard this patch.