Failed Conditions
Pull Request — develop (#6935)
by Michael
65:23
created
Doctrine/ORM/Tools/Console/Command/ClearCache/CollectionRegionCommand.php 1 patch
Spacing   +3 added lines, -3 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\Tools\Console\Command\ClearCache;
6 6
 
@@ -77,12 +77,12 @@  discard block
 block discarded – undo
77 77
             throw new \InvalidArgumentException('No second-level cache is configured on the given EntityManager.');
78 78
         }
79 79
 
80
-        if ( (! $ownerClass || ! $assoc) && ! $input->getOption('all')) {
80
+        if (( ! $ownerClass || ! $assoc) && ! $input->getOption('all')) {
81 81
             throw new \InvalidArgumentException('Missing arguments "--owner-class" "--association"');
82 82
         }
83 83
 
84 84
         if ($input->getOption('flush')) {
85
-            $collectionRegion  = $cache->getCollectionCacheRegion($ownerClass, $assoc);
85
+            $collectionRegion = $cache->getCollectionCacheRegion($ownerClass, $assoc);
86 86
 
87 87
             if ( ! $collectionRegion instanceof DefaultRegion) {
88 88
                 throw new \InvalidArgumentException(sprintf(
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/ValidateSchemaCommand.php 1 patch
Spacing   +4 added lines, -4 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\Tools\Console\Command;
6 6
 
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
             $output->writeln('<comment>[Mapping]  Skipped mapping check.</comment>');
64 64
         } elseif ($errors = $validator->validateMapping()) {
65 65
             foreach ($errors as $className => $errorMessages) {
66
-                $output->writeln("<error>[Mapping]  FAIL - The entity-class '" . $className . "' mapping is invalid:</error>");
66
+                $output->writeln("<error>[Mapping]  FAIL - The entity-class '".$className."' mapping is invalid:</error>");
67 67
 
68 68
                 foreach ($errorMessages as $errorMessage) {
69
-                    $output->writeln('* ' . $errorMessage);
69
+                    $output->writeln('* '.$errorMessage);
70 70
                 }
71 71
 
72 72
                 $output->writeln('');
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
         if ($input->getOption('skip-sync')) {
81 81
             $output->writeln('<comment>[Database] SKIPPED - The database was not checked for synchronicity.</comment>');
82
-        } elseif (!$validator->schemaInSyncWithMetadata()) {
82
+        } elseif ( ! $validator->schemaInSyncWithMetadata()) {
83 83
             $output->writeln('<error>[Database] FAIL - The database schema is not in sync with the current mapping file.</error>');
84 84
             $exit += 2;
85 85
         } else {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/ORMException.php 1 patch
Spacing   +15 added lines, -15 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;
6 6
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public static function namedQueryNotFound($queryName)
33 33
     {
34
-        return new self('Could not find a named query by the name "' . $queryName . '"');
34
+        return new self('Could not find a named query by the name "'.$queryName.'"');
35 35
     }
36 36
 
37 37
     /**
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public static function namedNativeQueryNotFound($nativeQueryName)
43 43
     {
44
-        return new self('Could not find a named native query by the name "' . $nativeQueryName . '"');
44
+        return new self('Could not find a named native query by the name "'.$nativeQueryName.'"');
45 45
     }
46 46
 
47 47
     /**
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
     public static function entityMissingForeignAssignedId($entity, $relatedEntity)
54 54
     {
55 55
         return new self(
56
-            "Entity of type " . get_class($entity) . " has identity through a foreign entity " . get_class($relatedEntity) . ", " .
57
-            "however this entity has no identity itself. You have to call EntityManager#persist() on the related entity " .
58
-            "and make sure that an identifier was generated before trying to persist '" . get_class($entity) . "'. In case " .
59
-            "of Post Insert ID Generation (such as MySQL Auto-Increment) this means you have to call " .
56
+            "Entity of type ".get_class($entity)." has identity through a foreign entity ".get_class($relatedEntity).", ".
57
+            "however this entity has no identity itself. You have to call EntityManager#persist() on the related entity ".
58
+            "and make sure that an identifier was generated before trying to persist '".get_class($entity)."'. In case ".
59
+            "of Post Insert ID Generation (such as MySQL Auto-Increment) this means you have to call ".
60 60
             "EntityManager#flush() between both persist operations."
61 61
         );
62 62
     }
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public static function entityMissingAssignedIdForField($entity, $field)
71 71
     {
72
-        return new self("Entity of type " . get_class($entity) . " is missing an assigned ID for field  '" . $field . "'. " .
72
+        return new self("Entity of type ".get_class($entity)." is missing an assigned ID for field  '".$field."'. ".
73 73
             "The identifier generation strategy for this entity requires the ID field to be populated before ".
74
-            "EntityManager#persist() is called. If you want automatically generated identifiers instead " .
74
+            "EntityManager#persist() is called. If you want automatically generated identifiers instead ".
75 75
             "you need to adjust the metadata mapping accordingly."
76 76
         );
77 77
     }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     public static function invalidOrientation($className, $field)
110 110
     {
111
-        return new self("Invalid order by orientation specified for " . $className . "#" . $field);
111
+        return new self("Invalid order by orientation specified for ".$className."#".$field);
112 112
     }
113 113
 
114 114
     /**
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      */
241 241
     public static function queryCacheUsesNonPersistentCache(CacheDriver $cache)
242 242
     {
243
-        return new self('Query Cache uses a non-persistent cache driver, ' . get_class($cache) . '.');
243
+        return new self('Query Cache uses a non-persistent cache driver, '.get_class($cache).'.');
244 244
     }
245 245
 
246 246
     /**
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
      */
251 251
     public static function metadataCacheUsesNonPersistentCache(CacheDriver $cache)
252 252
     {
253
-        return new self('Metadata Cache uses a non-persistent cache driver, ' . get_class($cache) . '.');
253
+        return new self('Metadata Cache uses a non-persistent cache driver, '.get_class($cache).'.');
254 254
     }
255 255
 
256 256
     /**
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
      */
292 292
     public static function missingIdentifierField($className, $fieldName)
293 293
     {
294
-        return new self("The identifier $fieldName is missing for a query of " . $className);
294
+        return new self("The identifier $fieldName is missing for a query of ".$className);
295 295
     }
296 296
 
297 297
     /**
@@ -303,8 +303,8 @@  discard block
 block discarded – undo
303 303
     public static function unrecognizedIdentifierFields($className, $fieldNames)
304 304
     {
305 305
         return new self(
306
-            "Unrecognized identifier fields: '" . implode("', '", $fieldNames) . "' " .
307
-            "are not present on class '" . $className . "'."
306
+            "Unrecognized identifier fields: '".implode("', '", $fieldNames)."' ".
307
+            "are not present on class '".$className."'."
308 308
         );
309 309
     }
310 310
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/OptimisticLockException.php 1 patch
Spacing   +3 added lines, -3 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;
6 6
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $expectedLockVersion = ($expectedLockVersion instanceof \DateTime) ? $expectedLockVersion->getTimestamp() : $expectedLockVersion;
62 62
         $actualLockVersion = ($actualLockVersion instanceof \DateTime) ? $actualLockVersion->getTimestamp() : $actualLockVersion;
63 63
 
64
-        return new self("The optimistic lock failed, version " . $expectedLockVersion . " was expected, but is actually ".$actualLockVersion, $entity);
64
+        return new self("The optimistic lock failed, version ".$expectedLockVersion." was expected, but is actually ".$actualLockVersion, $entity);
65 65
     }
66 66
 
67 67
     /**
@@ -71,6 +71,6 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public static function notVersioned($entityName)
73 73
     {
74
-        return new self("Cannot obtain optimistic lock on unversioned entity " . $entityName, null);
74
+        return new self("Cannot obtain optimistic lock on unversioned entity ".$entityName, null);
75 75
     }
76 76
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/EntityRepository.php 1 patch
Spacing   +4 added lines, -4 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;
6 6
 
@@ -292,14 +292,14 @@  discard block
 block discarded – undo
292 292
      */
293 293
     private function resolveMagicCall($method, $by, array $arguments)
294 294
     {
295
-        if (! $arguments) {
296
-            throw ORMException::findByRequiresParameter($method . $by);
295
+        if ( ! $arguments) {
296
+            throw ORMException::findByRequiresParameter($method.$by);
297 297
         }
298 298
 
299 299
         $fieldName = lcfirst(Inflector::classify($by));
300 300
 
301 301
         if (null === $this->class->getProperty($fieldName)) {
302
-            throw ORMException::invalidMagicCall($this->entityName, $fieldName, $method . $by);
302
+            throw ORMException::invalidMagicCall($this->entityName, $fieldName, $method.$by);
303 303
         }
304 304
 
305 305
         return $this->$method([$fieldName => $arguments[0]], ...array_slice($arguments, 1));
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Sequencing/Generator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-declare(strict_types=1);
4
+declare(strict_types = 1);
5 5
 
6 6
 namespace Doctrine\ORM\Sequencing;
7 7
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Sequencing/TableGenerator.php 1 patch
Spacing   +2 added lines, -2 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\Sequencing;
6 6
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
                         $this->tableName, $this->sequenceName, $this->allocationSize
78 78
                     );
79 79
 
80
-                    if ($conn->executeUpdate($updateSql, [1 => $currentLevel, 2 => $currentLevel+1]) !== 1) {
80
+                    if ($conn->executeUpdate($updateSql, [1 => $currentLevel, 2 => $currentLevel + 1]) !== 1) {
81 81
                         // no affected rows, concurrency issue, throw exception
82 82
                     }
83 83
                 } else {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Sequencing/Planning/CompositeValueGenerationPlan.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-declare(strict_types=1);
4
+declare(strict_types = 1);
5 5
 
6 6
 namespace Doctrine\ORM\Sequencing\Planning;
7 7
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     public function executeDeferred(EntityManagerInterface $entityManager, /*object*/ $entity): void
41 41
     {
42 42
         foreach ($this->executors as $executor) {
43
-            if (! $executor->isDeferred()) {
43
+            if ( ! $executor->isDeferred()) {
44 44
                 continue;
45 45
             }
46 46
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Sequencing/Planning/NoopValueGenerationPlan.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-declare(strict_types=1);
4
+declare(strict_types = 1);
5 5
 
6 6
 namespace Doctrine\ORM\Sequencing\Planning;
7 7
 
Please login to merge, or discard this patch.