Completed
Pull Request — master (#7902)
by
unknown
63:54
created
lib/Doctrine/ORM/Query.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 
233 233
         // Check query cache.
234 234
         $queryCache = $this->getQueryCacheDriver();
235
-        if (! ($this->useQueryCache && $queryCache)) {
235
+        if ( ! ($this->useQueryCache && $queryCache)) {
236 236
             $parser = new Parser($this);
237 237
 
238 238
             $this->parserResult = $parser->parse();
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
         foreach ($this->parameters as $parameter) {
368 368
             $key = $parameter->getName();
369 369
 
370
-            if (! isset($paramMappings[$key])) {
370
+            if ( ! isset($paramMappings[$key])) {
371 371
                 throw QueryException::unknownParameter($key);
372 372
             }
373 373
 
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
     public function setLockMode($lockMode)
697 697
     {
698 698
         if (\in_array($lockMode, [LockMode::NONE, LockMode::PESSIMISTIC_READ, LockMode::PESSIMISTIC_WRITE], true)) {
699
-            if (! $this->em->getConnection()->isTransactionActive()) {
699
+            if ( ! $this->em->getConnection()->isTransactionActive()) {
700 700
                 throw TransactionRequiredException::transactionRequired();
701 701
             }
702 702
         }
@@ -737,11 +737,11 @@  discard block
 block discarded – undo
737 737
             ->getName();
738 738
 
739 739
         return \md5(
740
-            $this->getDQL() . \serialize($this->hints) .
741
-            '&platform=' . $platform .
742
-            ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : '') .
743
-            '&firstResult=' . $this->firstResult . '&maxResult=' . $this->maxResults .
744
-            '&hydrationMode=' . $this->hydrationMode . '&types=' . \serialize($this->parsedTypes) . 'DOCTRINE_QUERY_CACHE_SALT'
740
+            $this->getDQL().\serialize($this->hints).
741
+            '&platform='.$platform.
742
+            ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : '').
743
+            '&firstResult='.$this->firstResult.'&maxResult='.$this->maxResults.
744
+            '&hydrationMode='.$this->hydrationMode.'&types='.\serialize($this->parsedTypes).'DOCTRINE_QUERY_CACHE_SALT'
745 745
         );
746 746
     }
747 747
 
@@ -750,7 +750,7 @@  discard block
 block discarded – undo
750 750
      */
751 751
     protected function getHash()
752 752
     {
753
-        return \sha1(parent::getHash() . '-' . $this->firstResult . '-' . $this->maxResults);
753
+        return \sha1(parent::getHash().'-'.$this->firstResult.'-'.$this->maxResults);
754 754
     }
755 755
 
756 756
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Factory/ClassMetadataDefinitionFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     ) : ClassMetadataDefinition {
31 31
         $definition = $this->createDefinition($className, $parentMetadata);
32 32
 
33
-        if (! \class_exists($definition->metadataClassName, false)) {
33
+        if ( ! \class_exists($definition->metadataClassName, false)) {
34 34
             $metadataClassPath = $this->resolver->resolveMetadataClassPath($className);
35 35
 
36 36
             $this->generatorStrategy->generate($metadataClassPath, $definition, $metadataBuildingContext);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Factory/Autoloader.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
ORM/Mapping/Factory/Strategy/FileWriterClassMetadataGeneratorStrategy.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
         $this->ensureDirectoryIsReady(\dirname($filePath));
42 42
 
43
-        $tmpFileName = $filePath . '.' . \uniqid('', true);
43
+        $tmpFileName = $filePath.'.'.\uniqid('', true);
44 44
 
45 45
         \file_put_contents($tmpFileName, $sourceCode);
46 46
         @\chmod($tmpFileName, 0664);
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
      */
55 55
     private function ensureDirectoryIsReady(string $directory)
56 56
     {
57
-        if (! \is_dir($directory) && (@\mkdir($directory, 0775, true) === false)) {
57
+        if ( ! \is_dir($directory) && (@\mkdir($directory, 0775, true) === false)) {
58 58
             throw new RuntimeException(\sprintf('Your metadata directory "%s" must be writable', $directory));
59 59
         }
60 60
 
61
-        if (! \is_writable($directory)) {
61
+        if ( ! \is_writable($directory)) {
62 62
             throw new RuntimeException(\sprintf('Your proxy directory "%s" must be writable', $directory));
63 63
         }
64 64
     }
Please login to merge, or discard this patch.
Factory/Strategy/ConditionalFileWriterClassMetadataGeneratorStrategy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         ClassMetadataDefinition $definition,
19 19
         ClassMetadataBuildingContext $metadataBuildingContext
20 20
     ) : void {
21
-        if (! \file_exists($filePath)) {
21
+        if ( ! \file_exists($filePath)) {
22 22
             parent::generate($filePath, $definition, $metadataBuildingContext);
23 23
 
24 24
             return;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Factory/DefaultNamingStrategy.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         ?string $className = null,
44 44
         ?string $embeddedClassName = null
45 45
     ) : string {
46
-        return $propertyName . '_' . $embeddedColumnName;
46
+        return $propertyName.'_'.$embeddedColumnName;
47 47
     }
48 48
 
49 49
     /**
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public function joinColumnName(string $propertyName, ?string $className = null) : string
61 61
     {
62
-        return $propertyName . '_' . $this->referenceColumnName();
62
+        return $propertyName.'_'.$this->referenceColumnName();
63 63
     }
64 64
 
65 65
     /**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function joinTableName(string $sourceEntity, string $targetEntity, ?string $propertyName = null) : string
69 69
     {
70
-        return \strtolower($this->classToTableName($sourceEntity) . '_' .
70
+        return \strtolower($this->classToTableName($sourceEntity).'_'.
71 71
             $this->classToTableName($targetEntity));
72 72
     }
73 73
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     public function joinKeyColumnName(string $entityName, ?string $referencedColumnName = null) : string
78 78
     {
79 79
         return \strtolower(
80
-            $this->classToTableName($entityName) . '_' . ($referencedColumnName ?: $this->referenceColumnName())
80
+            $this->classToTableName($entityName).'_'.($referencedColumnName ?: $this->referenceColumnName())
81 81
         );
82 82
     }
83 83
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
                 $fieldName = (string) $overrideElement['name'];
302 302
                 $property  = $classMetadata->getProperty($fieldName);
303 303
 
304
-                if (! $property) {
304
+                if ( ! $property) {
305 305
                     throw Mapping\MappingException::invalidOverrideFieldName($classMetadata->getClassName(), $fieldName);
306 306
                 }
307 307
 
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
                 $fieldName = (string) $overrideElement['name'];
336 336
                 $property  = $classMetadata->getProperty($fieldName);
337 337
 
338
-                if (! $property) {
338
+                if ( ! $property) {
339 339
                     throw Mapping\MappingException::invalidOverrideFieldName($classMetadata->getClassName(), $fieldName);
340 340
                 }
341 341
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
                 // Check for fetch
394 394
                 if (isset($overrideElement['fetch'])) {
395 395
                     $override->setFetchMode(
396
-                        \constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $overrideElement['fetch'])
396
+                        \constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $overrideElement['fetch'])
397 397
                     );
398 398
                 }
399 399
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
         // Evaluate <lifecycle-callbacks...>
405 405
         if (isset($xmlRoot->{'lifecycle-callbacks'})) {
406 406
             foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) {
407
-                $eventName  = \constant(Events::class . '::' . (string) $lifecycleCallback['type']);
407
+                $eventName  = \constant(Events::class.'::'.(string) $lifecycleCallback['type']);
408 408
                 $methodName = (string) $lifecycleCallback['method'];
409 409
 
410 410
                 $classMetadata->addLifecycleCallback($eventName, $methodName);
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
             foreach ($xmlRoot->{'entity-listeners'}->{'entity-listener'} as $listenerElement) {
417 417
                 $listenerClassName = (string) $listenerElement['class'];
418 418
 
419
-                if (! \class_exists($listenerClassName)) {
419
+                if ( ! \class_exists($listenerClassName)) {
420 420
                     throw Mapping\MappingException::entityListenerClassNotFound(
421 421
                         $listenerClassName,
422 422
                         $classMetadata->getClassName()
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
     ) : Mapping\ComponentMetadata {
146 146
         $this->reverseEngineerMappingFromDatabase();
147 147
 
148
-        if (! isset($this->classToTableNames[$className])) {
149
-            throw new InvalidArgumentException('Unknown class ' . $className);
148
+        if ( ! isset($this->classToTableNames[$className])) {
149
+            throw new InvalidArgumentException('Unknown class '.$className);
150 150
         }
151 151
 
152 152
         $metadata = new Mapping\ClassMetadata($className, $parent);
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
                     }
176 176
                 }
177 177
 
178
-                if (! $otherFk) {
178
+                if ( ! $otherFk) {
179 179
                     // the definition of this many to many table does not contain
180 180
                     // enough foreign key information to continue reverse engineering.
181 181
                     continue;
@@ -258,9 +258,9 @@  discard block
 block discarded – undo
258 258
                 $allForeignKeyColumns = \array_merge($allForeignKeyColumns, $foreignKey->getLocalColumns());
259 259
             }
260 260
 
261
-            if (! $table->hasPrimaryKey()) {
261
+            if ( ! $table->hasPrimaryKey()) {
262 262
                 throw new Mapping\MappingException(
263
-                    'Table ' . $table->getName() . ' has no primary key. Doctrine does not ' .
263
+                    'Table '.$table->getName().' has no primary key. Doctrine does not '.
264 264
                     "support reverse engineering from tables that don't have a primary key."
265 265
                 );
266 266
             }
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
             }
458 458
 
459 459
             // Here we need to check if $fkColumns are the same as $primaryKeys
460
-            if (! \array_diff($fkColumns, $primaryKeys)) {
460
+            if ( ! \array_diff($fkColumns, $primaryKeys)) {
461 461
                 $metadata->addProperty($associationMapping);
462 462
             } else {
463 463
                 $metadata->addProperty($associationMapping);
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
      */
503 503
     private function getClassNameForTable($tableName)
504 504
     {
505
-        return $this->namespace . (
505
+        return $this->namespace.(
506 506
             $this->classNamesForTables[$tableName]
507 507
                 ?? Inflector::classify(\strtolower($tableName))
508 508
         );
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
             return $this->classNames;
205 205
         }
206 206
 
207
-        if (! $this->paths) {
207
+        if ( ! $this->paths) {
208 208
             throw Mapping\MappingException::pathRequired();
209 209
         }
210 210
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
         $includedFiles = [];
213 213
 
214 214
         foreach ($this->paths as $path) {
215
-            if (! \is_dir($path)) {
215
+            if ( ! \is_dir($path)) {
216 216
                 throw Mapping\MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
217 217
             }
218 218
 
@@ -221,14 +221,14 @@  discard block
 block discarded – undo
221 221
                     new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS),
222 222
                     RecursiveIteratorIterator::LEAVES_ONLY
223 223
                 ),
224
-                '/^.+' . \preg_quote($this->fileExtension) . '$/i',
224
+                '/^.+'.\preg_quote($this->fileExtension).'$/i',
225 225
                 RecursiveRegexIterator::GET_MATCH
226 226
             );
227 227
 
228 228
             foreach ($iterator as $file) {
229 229
                 $sourceFile = $file[0];
230 230
 
231
-                if (! \preg_match('(^phar:)i', $sourceFile)) {
231
+                if ( ! \preg_match('(^phar:)i', $sourceFile)) {
232 232
                     $sourceFile = \realpath($sourceFile);
233 233
                 }
234 234
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
             ->withCacheAnnotation($classAnnotations[Annotation\Cache::class] ?? null)
295 295
             ->build();
296 296
 
297
-        if (! $classMetadata->isEmbeddedClass) {
297
+        if ( ! $classMetadata->isEmbeddedClass) {
298 298
             $this->attachLifecycleCallbacks($classAnnotations, $reflectionClass, $classMetadata);
299 299
             $this->attachEntityListeners($classAnnotations, $classMetadata);
300 300
         }
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
             ];
366 366
 
367 367
             foreach ($entityListenersAnnot->value as $listenerClassName) {
368
-                if (! \class_exists($listenerClassName)) {
368
+                if ( ! \class_exists($listenerClassName)) {
369 369
                     throw Mapping\MappingException::entityListenerClassNotFound(
370 370
                         $listenerClassName,
371 371
                         $metadata->getClassName()
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
                 $fieldName = $associationOverrideAnnotation->name;
454 454
                 $property  = $metadata->getProperty($fieldName);
455 455
 
456
-                if (! $property) {
456
+                if ( ! $property) {
457 457
                     throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName);
458 458
                 }
459 459
 
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 
507 507
                 // Check for fetch
508 508
                 if ($associationOverrideAnnotation->fetch) {
509
-                    $override->setFetchMode(\constant(Mapping\FetchMode::class . '::' . $associationOverrideAnnotation->fetch));
509
+                    $override->setFetchMode(\constant(Mapping\FetchMode::class.'::'.$associationOverrideAnnotation->fetch));
510 510
                 }
511 511
 
512 512
                 $metadata->setPropertyOverride($override);
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
                 $fieldName = $attributeOverrideAnnotation->name;
528 528
                 $property  = $metadata->getProperty($fieldName);
529 529
 
530
-                if (! $property) {
530
+                if ( ! $property) {
531 531
                     throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName);
532 532
                 }
533 533
 
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
         $classAnnotations = $this->reader->getClassAnnotations($reflectionClass);
557 557
 
558 558
         foreach ($classAnnotations as $key => $annot) {
559
-            if (! \is_numeric($key)) {
559
+            if ( ! \is_numeric($key)) {
560 560
                 continue;
561 561
             }
562 562
 
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
         $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty);
575 575
 
576 576
         foreach ($propertyAnnotations as $key => $annot) {
577
-            if (! \is_numeric($key)) {
577
+            if ( ! \is_numeric($key)) {
578 578
                 continue;
579 579
             }
580 580
 
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
         $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod);
593 593
 
594 594
         foreach ($methodAnnotations as $key => $annot) {
595
-            if (! \is_numeric($key)) {
595
+            if ( ! \is_numeric($key)) {
596 596
                 continue;
597 597
             }
598 598
 
Please login to merge, or discard this patch.