Failed Conditions
Pull Request — master (#6900)
by
unknown
09:19
created
ORM/Mapping/Factory/Strategy/FileWriterClassMetadataGeneratorStrategy.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
         $this->ensureDirectoryIsReady(dirname($filePath));
37 37
 
38
-        $tmpFileName = $filePath . '.' . uniqid('', true);
38
+        $tmpFileName = $filePath.'.'.uniqid('', true);
39 39
 
40 40
         file_put_contents($tmpFileName, $sourceCode);
41 41
         @chmod($tmpFileName, 0664);
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
      */
50 50
     private function ensureDirectoryIsReady(string $directory)
51 51
     {
52
-        if (! is_dir($directory) && (@mkdir($directory, 0775, true) === false)) {
52
+        if ( ! is_dir($directory) && (@mkdir($directory, 0775, true) === false)) {
53 53
             throw new \RuntimeException(sprintf('Your metadata directory "%s" must be writable', $directory));
54 54
         }
55 55
 
56
-        if (! is_writable($directory)) {
56
+        if ( ! is_writable($directory)) {
57 57
             throw new \RuntimeException(sprintf('Your proxy directory "%s" must be writable', $directory));
58 58
         }
59 59
     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Factory/RuntimeClassMetadataFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 
18 18
     protected function getReflectionService() : RuntimeReflectionService
19 19
     {
20
-        if (! $this->reflectionService) {
20
+        if ( ! $this->reflectionService) {
21 21
             $this->reflectionService = new RuntimeReflectionService();
22 22
         }
23 23
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Factory/UnderscoreNamingStrategy.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function embeddedFieldToColumnName($propertyName, $embeddedColumnName, $className = null, $embeddedClassName = null)
78 78
     {
79
-        return $this->underscore($propertyName) . '_' . $embeddedColumnName;
79
+        return $this->underscore($propertyName).'_'.$embeddedColumnName;
80 80
     }
81 81
 
82 82
     /**
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function joinColumnName($propertyName, $className = null)
94 94
     {
95
-        return $this->underscore($propertyName) . '_' . $this->referenceColumnName();
95
+        return $this->underscore($propertyName).'_'.$this->referenceColumnName();
96 96
     }
97 97
 
98 98
     /**
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      */
101 101
     public function joinTableName($sourceEntity, $targetEntity, $propertyName = null)
102 102
     {
103
-        return $this->classToTableName($sourceEntity) . '_' . $this->classToTableName($targetEntity);
103
+        return $this->classToTableName($sourceEntity).'_'.$this->classToTableName($targetEntity);
104 104
     }
105 105
 
106 106
     /**
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     public function joinKeyColumnName($entityName, $referencedColumnName = null)
110 110
     {
111
-        return $this->classToTableName($entityName) . '_' .
111
+        return $this->classToTableName($entityName).'_'.
112 112
                 ($referencedColumnName ?: $this->referenceColumnName());
113 113
     }
114 114
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Factory/StaticClassMetadataFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 
18 18
     protected function getReflectionService() : StaticReflectionService
19 19
     {
20
-        if (! $this->reflectionService) {
20
+        if ( ! $this->reflectionService) {
21 21
             $this->reflectionService = new StaticReflectionService();
22 22
         }
23 23
 
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
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         // remove namespace separators from remaining class name
46 46
         $fileName = str_replace('\\', '', $classNameRelativeToMetadataNamespace);
47 47
 
48
-        return $metadataDir . DIRECTORY_SEPARATOR . $fileName . '.php';
48
+        return $metadataDir.DIRECTORY_SEPARATOR.$fileName.'.php';
49 49
     }
50 50
 
51 51
     /**
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     ) : \Closure {
63 63
         $metadataNamespace = ltrim($metadataNamespace, '\\');
64 64
 
65
-        if (! ($notFoundCallback === null || is_callable($notFoundCallback))) {
65
+        if ( ! ($notFoundCallback === null || is_callable($notFoundCallback))) {
66 66
             $type = is_object($notFoundCallback) ? get_class($notFoundCallback) : gettype($notFoundCallback);
67 67
 
68 68
             throw new InvalidArgumentException(
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             );
71 71
         }
72 72
 
73
-        $autoloader = function ($className) use ($metadataDir, $metadataNamespace, $notFoundCallback) {
73
+        $autoloader = function($className) use ($metadataDir, $metadataNamespace, $notFoundCallback) {
74 74
             if (strpos($className, $metadataNamespace) === 0) {
75 75
                 $file = Autoloader::resolveFile($metadataDir, $metadataNamespace, $className);
76 76
 
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
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     {
27 27
         $definition = $this->createDefinition($className, $parentMetadata);
28 28
 
29
-        if (! class_exists($definition->metadataClassName, false)) {
29
+        if ( ! class_exists($definition->metadataClassName, false)) {
30 30
             $metadataClassPath = $this->resolver->resolveMetadataClassPath($className);
31 31
 
32 32
             $this->generatorStrategy->generate($metadataClassPath, $definition);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Factory/AbstractClassMetadataFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@
 block discarded – undo
151 151
      */
152 152
     private function getOrCreateClassMetadataDefinition(string $className, ?ClassMetadata $parent) : ClassMetadataDefinition
153 153
     {
154
-        if (! isset($this->definitions[$className])) {
154
+        if ( ! isset($this->definitions[$className])) {
155 155
             $this->definitions[$className] = $this->definitionFactory->build($className, $parent);
156 156
         }
157 157
 
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
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function embeddedFieldToColumnName($propertyName, $embeddedColumnName, $className = null, $embeddedClassName = null)
41 41
     {
42
-        return $propertyName . '_' . $embeddedColumnName;
42
+        return $propertyName.'_'.$embeddedColumnName;
43 43
     }
44 44
 
45 45
     /**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function joinColumnName($propertyName, $className = null)
57 57
     {
58
-        return $propertyName . '_' . $this->referenceColumnName();
58
+        return $propertyName.'_'.$this->referenceColumnName();
59 59
     }
60 60
 
61 61
     /**
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function joinTableName($sourceEntity, $targetEntity, $propertyName = null)
65 65
     {
66
-        return strtolower($this->classToTableName($sourceEntity) . '_' .
66
+        return strtolower($this->classToTableName($sourceEntity).'_'.
67 67
             $this->classToTableName($targetEntity));
68 68
     }
69 69
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function joinKeyColumnName($entityName, $referencedColumnName = null)
74 74
     {
75
-        return strtolower($this->classToTableName($entityName) . '_' .
75
+        return strtolower($this->classToTableName($entityName).'_'.
76 76
             ($referencedColumnName ?: $this->referenceColumnName()));
77 77
     }
78 78
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/MappingException.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      */
23 23
     public static function pathRequired()
24 24
     {
25
-        return new self('Specifying the paths to your entities is required ' .
25
+        return new self('Specifying the paths to your entities is required '.
26 26
             'in the AnnotationDriver to retrieve all class names.');
27 27
     }
28 28
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
      */
213 213
     public static function missingQueryMapping($entity, $queryName)
214 214
     {
215
-        return new self('Query named "' . $queryName . '" in "' . $entity . ' requires a result class or result set mapping.');
215
+        return new self('Query named "'.$queryName.'" in "'.$entity.' requires a result class or result set mapping.');
216 216
     }
217 217
 
218 218
     /**
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
      */
224 224
     public static function missingResultSetMappingEntity($entity, $resultName)
225 225
     {
226
-        return new self('Result set mapping named "' . $resultName . '" in "' . $entity . ' requires a entity class name.');
226
+        return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a entity class name.');
227 227
     }
228 228
 
229 229
     /**
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
      */
235 235
     public static function missingResultSetMappingFieldName($entity, $resultName)
236 236
     {
237
-        return new self('Result set mapping named "' . $resultName . '" in "' . $entity . ' requires a field name.');
237
+        return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a field name.');
238 238
     }
239 239
 
240 240
     /**
@@ -281,8 +281,8 @@  discard block
 block discarded – undo
281 281
     {
282 282
         $message = sprintf("The mapping of field '%s' is invalid: The option '%s' is required.", $field, $expectedOption);
283 283
 
284
-        if (! empty($hint)) {
285
-            $message .= ' (Hint: ' . $hint . ')';
284
+        if ( ! empty($hint)) {
285
+            $message .= ' (Hint: '.$hint.')';
286 286
         }
287 287
 
288 288
         return new self($message);
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
      */
312 312
     public static function reflectionFailure($entity, \ReflectionException $previousException)
313 313
     {
314
-        return new self('An error occurred in ' . $entity, 0, $previousException);
314
+        return new self('An error occurred in '.$entity, 0, $previousException);
315 315
     }
316 316
 
317 317
     /**
@@ -322,8 +322,8 @@  discard block
 block discarded – undo
322 322
      */
323 323
     public static function joinColumnMustPointToMappedField($className, $joinColumn)
324 324
     {
325
-        return new self('The column ' . $joinColumn . ' must be mapped to a field in class '
326
-            . $className . ' since it is referenced by a join column of another class.');
325
+        return new self('The column '.$joinColumn.' must be mapped to a field in class '
326
+            . $className.' since it is referenced by a join column of another class.');
327 327
     }
328 328
 
329 329
     /**
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
      */
358 358
     public static function propertyTypeIsRequired($className, $propertyName)
359 359
     {
360
-        return new self("The attribute 'type' is required for the column description of property " . $className . '::$' . $propertyName . '.');
360
+        return new self("The attribute 'type' is required for the column description of property ".$className.'::$'.$propertyName.'.');
361 361
     }
362 362
 
363 363
     /**
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
      */
368 368
     public static function tableIdGeneratorNotImplemented($className)
369 369
     {
370
-        return new self('TableIdGenerator is not yet implemented for use with class ' . $className);
370
+        return new self('TableIdGenerator is not yet implemented for use with class '.$className);
371 371
     }
372 372
 
373 373
     /**
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
      */
394 394
     public static function duplicateQueryMapping($entity, $queryName)
395 395
     {
396
-        return new self('Query named "' . $queryName . '" in "' . $entity . '" was already declared, but it must be declared only once');
396
+        return new self('Query named "'.$queryName.'" in "'.$entity.'" was already declared, but it must be declared only once');
397 397
     }
398 398
 
399 399
     /**
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
      */
405 405
     public static function duplicateResultSetMapping($entity, $resultName)
406 406
     {
407
-        return new self('Result set mapping named "' . $resultName . '" in "' . $entity . '" was already declared, but it must be declared only once');
407
+        return new self('Result set mapping named "'.$resultName.'" in "'.$entity.'" was already declared, but it must be declared only once');
408 408
     }
409 409
 
410 410
     /**
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
      */
415 415
     public static function singleIdNotAllowedOnCompositePrimaryKey($entity)
416 416
     {
417
-        return new self('Single id is not allowed on composite primary key in entity ' . $entity);
417
+        return new self('Single id is not allowed on composite primary key in entity '.$entity);
418 418
     }
419 419
 
420 420
     /**
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
      */
425 425
     public static function noIdDefined($entity)
426 426
     {
427
-        return new self('No ID defined for entity ' . $entity);
427
+        return new self('No ID defined for entity '.$entity);
428 428
     }
429 429
 
430 430
     /**
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
      */
435 435
     public static function unsupportedOptimisticLockingType($unsupportedType)
436 436
     {
437
-        return new self('Locking type "' . $unsupportedType . '" is not supported by Doctrine.');
437
+        return new self('Locking type "'.$unsupportedType.'" is not supported by Doctrine.');
438 438
     }
439 439
 
440 440
     /**
@@ -444,13 +444,13 @@  discard block
 block discarded – undo
444 444
      */
445 445
     public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null)
446 446
     {
447
-        if (! empty($path)) {
448
-            $path = '[' . $path . ']';
447
+        if ( ! empty($path)) {
448
+            $path = '['.$path.']';
449 449
         }
450 450
 
451 451
         return new self(
452
-            'File mapping drivers must have a valid directory path, ' .
453
-            'however the given path ' . $path . ' seems to be incorrect!'
452
+            'File mapping drivers must have a valid directory path, '.
453
+            'however the given path '.$path.' seems to be incorrect!'
454 454
         );
455 455
     }
456 456
 
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
     public static function invalidClassInDiscriminatorMap($className, $owningClass)
467 467
     {
468 468
         return new self(sprintf(
469
-            "Entity class '%s' used in the discriminator map of class '%s' " .
469
+            "Entity class '%s' used in the discriminator map of class '%s' ".
470 470
             'does not exist.',
471 471
             $className,
472 472
             $owningClass
@@ -483,15 +483,15 @@  discard block
 block discarded – undo
483 483
     public static function duplicateDiscriminatorEntry($className, array $entries, array $map)
484 484
     {
485 485
         return new self(
486
-            'The entries ' . implode(', ', $entries) . " in discriminator map of class '" . $className . "' is duplicated. " .
487
-            'If the discriminator map is automatically generated you have to convert it to an explicit discriminator map now. ' .
488
-            'The entries of the current map are: @DiscriminatorMap({' . implode(', ', array_map(
489
-                function ($a, $b) {
486
+            'The entries '.implode(', ', $entries)." in discriminator map of class '".$className."' is duplicated. ".
487
+            'If the discriminator map is automatically generated you have to convert it to an explicit discriminator map now. '.
488
+            'The entries of the current map are: @DiscriminatorMap({'.implode(', ', array_map(
489
+                function($a, $b) {
490 490
                     return sprintf("'%s': '%s'", $a, $b);
491 491
                 },
492 492
                 array_keys($map),
493 493
                 array_values($map)
494
-            )) . '})'
494
+            )).'})'
495 495
         );
496 496
     }
497 497
 
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
     public static function sqlConversionNotAllowedForPrimaryKeyProperties($className, Property $property)
555 555
     {
556 556
         return new self(sprintf(
557
-            'It is not possible to set id field "%s" to type "%s" in entity class "%s". ' .
557
+            'It is not possible to set id field "%s" to type "%s" in entity class "%s". '.
558 558
             'The type "%s" requires conversion SQL which is not allowed for identifiers.',
559 559
             $property->getName(),
560 560
             $property->getTypeName(),
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
      */
591 591
     public static function duplicateColumnName($className, $columnName)
592 592
     {
593
-        return new self("Duplicate definition of column '" . $columnName . "' on entity '" . $className . "' in a field or discriminator column mapping.");
593
+        return new self("Duplicate definition of column '".$columnName."' on entity '".$className."' in a field or discriminator column mapping.");
594 594
     }
595 595
 
596 596
     /**
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
      */
602 602
     public static function illegalToManyAssociationOnMappedSuperclass($className, $field)
603 603
     {
604
-        return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '" . $className . '#' . $field . "'.");
604
+        return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '".$className.'#'.$field."'.");
605 605
     }
606 606
 
607 607
     /**
@@ -613,8 +613,8 @@  discard block
 block discarded – undo
613 613
      */
614 614
     public static function cannotMapCompositePrimaryKeyEntitiesAsForeignId($className, $targetEntity, $targetField)
615 615
     {
616
-        return new self("It is not possible to map entity '" . $className . "' with a composite primary key " .
617
-            "as part of the primary key of another entity '" . $targetEntity . '#' . $targetField . "'.");
616
+        return new self("It is not possible to map entity '".$className."' with a composite primary key ".
617
+            "as part of the primary key of another entity '".$targetEntity.'#'.$targetField."'.");
618 618
     }
619 619
 
620 620
     /**
@@ -668,8 +668,8 @@  discard block
 block discarded – undo
668 668
      */
669 669
     public static function illegalOrphanRemoval($className, $field)
670 670
     {
671
-        return new self('Orphan removal is only allowed on one-to-one and one-to-many ' .
672
-            'associations, but ' . $className . '#' . $field . ' is not.');
671
+        return new self('Orphan removal is only allowed on one-to-one and one-to-many '.
672
+            'associations, but '.$className.'#'.$field.' is not.');
673 673
     }
674 674
 
675 675
     /**
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
      */
702 702
     public static function noInheritanceOnMappedSuperClass($className)
703 703
     {
704
-        return new self("It is not supported to define inheritance information on a mapped superclass '" . $className . "'.");
704
+        return new self("It is not supported to define inheritance information on a mapped superclass '".$className."'.");
705 705
     }
706 706
 
707 707
     /**
@@ -713,8 +713,8 @@  discard block
 block discarded – undo
713 713
     public static function mappedClassNotPartOfDiscriminatorMap($className, $rootClassName)
714 714
     {
715 715
         return new self(
716
-            "Entity '" . $className . "' has to be part of the discriminator map of '" . $rootClassName . "' " .
717
-            "to be properly mapped in the inheritance hierarchy. Alternatively you can make '" . $className . "' an abstract class " .
716
+            "Entity '".$className."' has to be part of the discriminator map of '".$rootClassName."' ".
717
+            "to be properly mapped in the inheritance hierarchy. Alternatively you can make '".$className."' an abstract class ".
718 718
             'to avoid this exception from occurring.'
719 719
         );
720 720
     }
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
      */
728 728
     public static function lifecycleCallbackMethodNotFound($className, $methodName)
729 729
     {
730
-        return new self("Entity '" . $className . "' has no method '" . $methodName . "' to be registered as lifecycle callback.");
730
+        return new self("Entity '".$className."' has no method '".$methodName."' to be registered as lifecycle callback.");
731 731
     }
732 732
 
733 733
     /**
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
      */
774 774
     public static function invalidFetchMode($className, $annotation)
775 775
     {
776
-        return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'");
776
+        return new self("Entity '".$className."' has a mapping with invalid fetch mode '".$annotation."'");
777 777
     }
778 778
 
779 779
     /**
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
      */
784 784
     public static function compositeKeyAssignedIdGeneratorRequired($className)
785 785
     {
786
-        return new self("Entity '" . $className . "' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported.");
786
+        return new self("Entity '".$className."' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported.");
787 787
     }
788 788
 
789 789
     /**
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
      */
796 796
     public static function invalidTargetEntityClass($targetEntity, $sourceEntity, $associationName)
797 797
     {
798
-        return new self("The target-entity '" . $targetEntity . "' cannot be found in '" . $sourceEntity . '#' . $associationName . "'.");
798
+        return new self("The target-entity '".$targetEntity."' cannot be found in '".$sourceEntity.'#'.$associationName."'.");
799 799
     }
800 800
 
801 801
     /**
@@ -807,8 +807,8 @@  discard block
 block discarded – undo
807 807
      */
808 808
     public static function invalidCascadeOption(array $cascades, $className, $propertyName)
809 809
     {
810
-        $cascades = implode(', ', array_map(function ($e) {
811
-            return "'" . $e . "'";
810
+        $cascades = implode(', ', array_map(function($e) {
811
+            return "'".$e."'";
812 812
         }, $cascades));
813 813
 
814 814
         return new self(sprintf(
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
     {
842 842
         return new self(
843 843
             sprintf(
844
-                'Infinite nesting detected for embedded property %s::%s. ' .
844
+                'Infinite nesting detected for embedded property %s::%s. '.
845 845
                 'You cannot embed an embeddable from the same type inside an embeddable.',
846 846
                 $className,
847 847
                 $propertyName
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
     {
857 857
         return new self(
858 858
             sprintf(
859
-                'Class %s not found in namespaces %s.' .
859
+                'Class %s not found in namespaces %s.'.
860 860
                 $className,
861 861
                 implode(', ', $namespaces)
862 862
             )
Please login to merge, or discard this patch.