Failed Conditions
Pull Request — develop (#6873)
by
unknown
112:44 queued 47:41
created
lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -220,7 +220,7 @@
 block discarded – undo
220 220
             $exporter->setMetadata($metadata);
221 221
             $exporter->export();
222 222
 
223
-            $output->writeln(PHP_EOL . sprintf(
223
+            $output->writeln(PHP_EOL.sprintf(
224 224
                 'Converting Doctrine 1.X schema to "<info>%s</info>" mapping type in "<info>%s</info>"', $toType, $destPath
225 225
             ));
226 226
         } else {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         // Evaluate named native queries
110 110
         if (isset($element['namedNativeQueries'])) {
111 111
             foreach ($element['namedNativeQueries'] as $name => $mappingElement) {
112
-                if (!isset($mappingElement['name'])) {
112
+                if ( ! isset($mappingElement['name'])) {
113 113
                     $mappingElement['name'] = $name;
114 114
                 }
115 115
                 $metadata->addNamedNativeQuery(
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         // Evaluate sql result set mappings
127 127
         if (isset($element['sqlResultSetMappings'])) {
128 128
             foreach ($element['sqlResultSetMappings'] as $name => $resultSetMapping) {
129
-                if (!isset($resultSetMapping['name'])) {
129
+                if ( ! isset($resultSetMapping['name'])) {
130 130
                     $resultSetMapping['name'] = $name;
131 131
                 }
132 132
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         }
174 174
 
175 175
         if (isset($element['inheritanceType'])) {
176
-            $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . strtoupper($element['inheritanceType'])));
176
+            $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.strtoupper($element['inheritanceType'])));
177 177
 
178 178
             if ($metadata->inheritanceType != Metadata::INHERITANCE_TYPE_NONE) {
179 179
                 // Evaluate discriminatorColumn
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
                 }
363 363
 
364 364
                 if (isset($oneToOneElement['fetch'])) {
365
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToOneElement['fetch']);
365
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$oneToOneElement['fetch']);
366 366
                 }
367 367
 
368 368
                 if (isset($oneToOneElement['mappedBy'])) {
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
                 ];
417 417
 
418 418
                 if (isset($oneToManyElement['fetch'])) {
419
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToManyElement['fetch']);
419
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$oneToManyElement['fetch']);
420 420
                 }
421 421
 
422 422
                 if (isset($oneToManyElement['cascade'])) {
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
                 }
459 459
 
460 460
                 if (isset($manyToOneElement['fetch'])) {
461
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToOneElement['fetch']);
461
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$manyToOneElement['fetch']);
462 462
                 }
463 463
 
464 464
                 if (isset($manyToOneElement['inversedBy'])) {
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
                 ];
504 504
 
505 505
                 if (isset($manyToManyElement['fetch'])) {
506
-                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToManyElement['fetch']);
506
+                    $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$manyToManyElement['fetch']);
507 507
                 }
508 508
 
509 509
                 if (isset($manyToManyElement['mappedBy'])) {
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
         if (isset($element['associationOverride']) && is_array($element['associationOverride'])) {
574 574
 
575 575
             foreach ($element['associationOverride'] as $fieldName => $associationOverrideElement) {
576
-                $override   = [];
576
+                $override = [];
577 577
 
578 578
                 // Check for joinColumn
579 579
                 if (isset($associationOverrideElement['joinColumn'])) {
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
                 if (isset($associationOverrideElement['joinTable'])) {
592 592
 
593 593
                     $joinTableElement   = $associationOverrideElement['joinTable'];
594
-                    $joinTable          =  [
594
+                    $joinTable          = [
595 595
                         'name' => $joinTableElement['name']
596 596
                     ];
597 597
 
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
 
626 626
                 // Check for `fetch`
627 627
                 if (isset($associationOverrideElement['fetch'])) {
628
-                    $override['fetch'] = constant(Metadata::class . '::FETCH_' . $associationOverrideElement['fetch']);
628
+                    $override['fetch'] = constant(Metadata::class.'::FETCH_'.$associationOverrideElement['fetch']);
629 629
                 }
630 630
 
631 631
                 $metadata->setAssociationOverride($fieldName, $override);
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
         if (isset($element['lifecycleCallbacks'])) {
646 646
             foreach ($element['lifecycleCallbacks'] as $type => $methods) {
647 647
                 foreach ($methods as $method) {
648
-                    $metadata->addLifecycleCallback($method, constant('Doctrine\ORM\Events::' . $type));
648
+                    $metadata->addLifecycleCallback($method, constant('Doctrine\ORM\Events::'.$type));
649 649
                 }
650 650
             }
651 651
         }
@@ -787,12 +787,12 @@  discard block
 block discarded – undo
787 787
         $region = isset($cacheMapping['region']) ? (string) $cacheMapping['region'] : null;
788 788
         $usage  = isset($cacheMapping['usage']) ? strtoupper($cacheMapping['usage']) : null;
789 789
 
790
-        if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage)) {
790
+        if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage)) {
791 791
             throw new \InvalidArgumentException(sprintf('Invalid cache usage "%s"', $usage));
792 792
         }
793 793
 
794 794
         if ($usage) {
795
-            $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage);
795
+            $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage);
796 796
         }
797 797
 
798 798
         return [
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
     public function getSingleIdReflectionProperty()
697 697
     {
698 698
         if ($this->isIdentifierComposite) {
699
-            throw new BadMethodCallException("Class " . $this->name . " has a composite identifier.");
699
+            throw new BadMethodCallException("Class ".$this->name." has a composite identifier.");
700 700
         }
701 701
 
702 702
         return $this->reflFields[$this->identifier[0]];
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
      */
792 792
     public function __toString()
793 793
     {
794
-        return __CLASS__ . '@' . spl_object_hash($this);
794
+        return __CLASS__.'@'.spl_object_hash($this);
795 795
     }
796 796
 
797 797
     /**
@@ -1025,7 +1025,7 @@  discard block
 block discarded – undo
1025 1025
     public function validateAssociations()
1026 1026
     {
1027 1027
         foreach ($this->associationMappings as $mapping) {
1028
-            if ( ! ClassLoader::classExists($mapping['targetEntity']) ) {
1028
+            if ( ! ClassLoader::classExists($mapping['targetEntity'])) {
1029 1029
                 throw MappingException::invalidTargetEntityClass($mapping['targetEntity'], $this->name, $mapping['fieldName']);
1030 1030
             }
1031 1031
         }
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
         }
1104 1104
 
1105 1105
         if ( ! isset($cache['region'])) {
1106
-            $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)) . '__' . $fieldName;
1106
+            $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)).'__'.$fieldName;
1107 1107
         }
1108 1108
 
1109 1109
         return $cache;
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
     protected function _validateAndCompleteFieldMapping(array &$mapping)
1384 1384
     {
1385 1385
         // Check mandatory fields
1386
-        if ( ! isset($mapping['fieldName']) || !$mapping['fieldName']) {
1386
+        if ( ! isset($mapping['fieldName']) || ! $mapping['fieldName']) {
1387 1387
             throw MappingException::missingFieldName($this->name);
1388 1388
         }
1389 1389
 
@@ -1496,14 +1496,14 @@  discard block
 block discarded – undo
1496 1496
                 $this->isIdentifierComposite = true;
1497 1497
             }
1498 1498
 
1499
-            if ($this->cache && !isset($mapping['cache'])) {
1499
+            if ($this->cache && ! isset($mapping['cache'])) {
1500 1500
                 throw CacheException::nonCacheableEntityAssociation($this->name, $mapping['fieldName']);
1501 1501
             }
1502 1502
         }
1503 1503
 
1504 1504
         // Mandatory attributes for both sides
1505 1505
         // Mandatory: fieldName, targetEntity
1506
-        if ( ! isset($mapping['fieldName']) || !$mapping['fieldName']) {
1506
+        if ( ! isset($mapping['fieldName']) || ! $mapping['fieldName']) {
1507 1507
             throw MappingException::missingFieldName($this->name);
1508 1508
         }
1509 1509
 
@@ -1625,7 +1625,7 @@  discard block
 block discarded – undo
1625 1625
                     throw new RuntimeException("ClassMetadataInfo::setTable() has to be called before defining a one to one relationship.");
1626 1626
                 }
1627 1627
 
1628
-                $this->table['uniqueConstraints'][$mapping['fieldName'] . "_uniq"] = [
1628
+                $this->table['uniqueConstraints'][$mapping['fieldName']."_uniq"] = [
1629 1629
                     'columns' => $uniqueConstraintColumns
1630 1630
                 ];
1631 1631
             }
@@ -1640,7 +1640,7 @@  discard block
 block discarded – undo
1640 1640
             unset($mapping['unique']);
1641 1641
         }
1642 1642
 
1643
-        if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) {
1643
+        if (isset($mapping['id']) && $mapping['id'] === true && ! $mapping['isOwningSide']) {
1644 1644
             throw MappingException::illegalInverseIdentifierAssociation($this->name, $mapping['fieldName']);
1645 1645
         }
1646 1646
 
@@ -1694,7 +1694,7 @@  discard block
 block discarded – undo
1694 1694
             }
1695 1695
 
1696 1696
             $selfReferencingEntityWithoutJoinColumns = $mapping['sourceEntity'] == $mapping['targetEntity']
1697
-                && (! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns'])));
1697
+                && ( ! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns'])));
1698 1698
 
1699 1699
             if ( ! isset($mapping['joinTable']['joinColumns'])) {
1700 1700
                 $mapping['joinTable']['joinColumns'] = [
@@ -1887,7 +1887,7 @@  discard block
 block discarded – undo
1887 1887
 
1888 1888
             // Association defined as Id field
1889 1889
             $joinColumns      = $this->associationMappings[$idProperty]['joinColumns'];
1890
-            $assocColumnNames = array_map(function ($joinColumn) { return $joinColumn['name']; }, $joinColumns);
1890
+            $assocColumnNames = array_map(function($joinColumn) { return $joinColumn['name']; }, $joinColumns);
1891 1891
 
1892 1892
             $columnNames = array_merge($columnNames, $assocColumnNames);
1893 1893
         }
@@ -2068,7 +2068,7 @@  discard block
 block discarded – undo
2068 2068
     public function getTemporaryIdTableName()
2069 2069
     {
2070 2070
         // replace dots with underscores because PostgreSQL creates temporary tables in a special schema
2071
-        return str_replace('.', '_', $this->getTableName() . '_id_tmp');
2071
+        return str_replace('.', '_', $this->getTableName().'_id_tmp');
2072 2072
     }
2073 2073
 
2074 2074
     /**
@@ -2405,7 +2405,7 @@  discard block
 block discarded – undo
2405 2405
      */
2406 2406
     public function addNamedQuery(array $queryMapping)
2407 2407
     {
2408
-        if (!isset($queryMapping['name'])) {
2408
+        if ( ! isset($queryMapping['name'])) {
2409 2409
             throw MappingException::nameIsMandatoryForQueryMapping($this->name);
2410 2410
         }
2411 2411
 
@@ -2413,7 +2413,7 @@  discard block
 block discarded – undo
2413 2413
             throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']);
2414 2414
         }
2415 2415
 
2416
-        if (!isset($queryMapping['query'])) {
2416
+        if ( ! isset($queryMapping['query'])) {
2417 2417
             throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']);
2418 2418
         }
2419 2419
 
@@ -2440,7 +2440,7 @@  discard block
 block discarded – undo
2440 2440
      */
2441 2441
     public function addNamedNativeQuery(array $queryMapping)
2442 2442
     {
2443
-        if (!isset($queryMapping['name'])) {
2443
+        if ( ! isset($queryMapping['name'])) {
2444 2444
             throw MappingException::nameIsMandatoryForQueryMapping($this->name);
2445 2445
         }
2446 2446
 
@@ -2448,11 +2448,11 @@  discard block
 block discarded – undo
2448 2448
             throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']);
2449 2449
         }
2450 2450
 
2451
-        if (!isset($queryMapping['query'])) {
2451
+        if ( ! isset($queryMapping['query'])) {
2452 2452
             throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']);
2453 2453
         }
2454 2454
 
2455
-        if (!isset($queryMapping['resultClass']) && !isset($queryMapping['resultSetMapping'])) {
2455
+        if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) {
2456 2456
             throw MappingException::missingQueryMapping($this->name, $queryMapping['name']);
2457 2457
         }
2458 2458
 
@@ -2484,7 +2484,7 @@  discard block
 block discarded – undo
2484 2484
      */
2485 2485
     public function addSqlResultSetMapping(array $resultMapping)
2486 2486
     {
2487
-        if (!isset($resultMapping['name'])) {
2487
+        if ( ! isset($resultMapping['name'])) {
2488 2488
             throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name);
2489 2489
         }
2490 2490
 
@@ -2494,7 +2494,7 @@  discard block
 block discarded – undo
2494 2494
 
2495 2495
         if (isset($resultMapping['entities'])) {
2496 2496
             foreach ($resultMapping['entities'] as $key => $entityResult) {
2497
-                if (!isset($entityResult['entityClass'])) {
2497
+                if ( ! isset($entityResult['entityClass'])) {
2498 2498
                     throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']);
2499 2499
                 }
2500 2500
 
@@ -2513,11 +2513,11 @@  discard block
 block discarded – undo
2513 2513
 
2514 2514
                 if (isset($entityResult['fields'])) {
2515 2515
                     foreach ($entityResult['fields'] as $k => $field) {
2516
-                        if (!isset($field['name'])) {
2516
+                        if ( ! isset($field['name'])) {
2517 2517
                             throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']);
2518 2518
                         }
2519 2519
 
2520
-                        if (!isset($field['column'])) {
2520
+                        if ( ! isset($field['column'])) {
2521 2521
                             $fieldName = $field['name'];
2522 2522
                             if (strpos($fieldName, '.')) {
2523 2523
                                 list(, $fieldName) = explode('.', $fieldName);
@@ -3008,7 +3008,7 @@  discard block
 block discarded – undo
3008 3008
         }
3009 3009
 
3010 3010
         if ($definition['sequenceName'][0] == '`') {
3011
-            $definition['sequenceName']   = trim($definition['sequenceName'], '`');
3011
+            $definition['sequenceName'] = trim($definition['sequenceName'], '`');
3012 3012
             $definition['quoted'] = true;
3013 3013
         }
3014 3014
 
@@ -3100,7 +3100,7 @@  discard block
 block discarded – undo
3100 3100
     public function getAssociationTargetClass($assocName)
3101 3101
     {
3102 3102
         if ( ! isset($this->associationMappings[$assocName])) {
3103
-            throw new InvalidArgumentException("Association name expected, '" . $assocName ."' is not an association.");
3103
+            throw new InvalidArgumentException("Association name expected, '".$assocName."' is not an association.");
3104 3104
         }
3105 3105
 
3106 3106
         return $this->associationMappings[$assocName]['targetEntity'];
@@ -3139,7 +3139,7 @@  discard block
 block discarded – undo
3139 3139
             // Association defined as Id field
3140 3140
             $joinColumns            = $this->associationMappings[$idProperty]['joinColumns'];
3141 3141
             $assocQuotedColumnNames = array_map(
3142
-                function ($joinColumn) use ($platform) {
3142
+                function($joinColumn) use ($platform) {
3143 3143
                     return isset($joinColumn['quoted'])
3144 3144
                         ? $platform->quoteIdentifier($joinColumn['name'])
3145 3145
                         : $joinColumn['name'];
@@ -3250,7 +3250,7 @@  discard block
 block discarded – undo
3250 3250
         }
3251 3251
 
3252 3252
         if ($className !== null && strpos($className, '\\') === false && $this->namespace) {
3253
-            return $this->namespace . '\\' . $className;
3253
+            return $this->namespace.'\\'.$className;
3254 3254
         }
3255 3255
 
3256 3256
         return $className;
@@ -3302,13 +3302,13 @@  discard block
 block discarded – undo
3302 3302
         foreach ($embeddable->fieldMappings as $fieldMapping) {
3303 3303
             $fieldMapping['originalClass'] = $fieldMapping['originalClass'] ?? $embeddable->name;
3304 3304
             $fieldMapping['declaredField'] = isset($fieldMapping['declaredField'])
3305
-                ? $property . '.' . $fieldMapping['declaredField']
3305
+                ? $property.'.'.$fieldMapping['declaredField']
3306 3306
                 : $property;
3307 3307
             $fieldMapping['originalField'] = $fieldMapping['originalField'] ?? $fieldMapping['fieldName'];
3308
-            $fieldMapping['fieldName'] = $property . "." . $fieldMapping['fieldName'];
3308
+            $fieldMapping['fieldName'] = $property.".".$fieldMapping['fieldName'];
3309 3309
 
3310
-            if (! empty($this->embeddedClasses[$property]['columnPrefix'])) {
3311
-                $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName'];
3310
+            if ( ! empty($this->embeddedClasses[$property]['columnPrefix'])) {
3311
+                $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'].$fieldMapping['columnName'];
3312 3312
             } elseif ($this->embeddedClasses[$property]['columnPrefix'] !== false) {
3313 3313
                 $fieldMapping['columnName'] = $this->namingStrategy
3314 3314
                     ->embeddedFieldToColumnName(
@@ -3349,7 +3349,7 @@  discard block
 block discarded – undo
3349 3349
     {
3350 3350
         $sequencePrefix = $this->getSequencePrefix($platform);
3351 3351
         $columnName     = $this->getSingleIdentifierColumnName();
3352
-        $sequenceName   = $sequencePrefix . '_' . $columnName . '_seq';
3352
+        $sequenceName   = $sequencePrefix.'_'.$columnName.'_seq';
3353 3353
 
3354 3354
         return $sequenceName;
3355 3355
     }
@@ -3369,10 +3369,10 @@  discard block
 block discarded – undo
3369 3369
 
3370 3370
         // Prepend the schema name to the table name if there is one
3371 3371
         if ($schemaName = $this->getSchemaName()) {
3372
-            $sequencePrefix = $schemaName . '.' . $tableName;
3372
+            $sequencePrefix = $schemaName.'.'.$tableName;
3373 3373
 
3374 3374
             if ( ! $platform->supportsSchemas() && $platform->canEmulateSchemas()) {
3375
-                $sequencePrefix = $schemaName . '__' . $tableName;
3375
+                $sequencePrefix = $schemaName.'__'.$tableName;
3376 3376
             }
3377 3377
         }
3378 3378
 
@@ -3384,8 +3384,8 @@  discard block
 block discarded – undo
3384 3384
      */
3385 3385
     private function assertMappingOrderBy(array $mapping)
3386 3386
     {
3387
-        if (isset($mapping['orderBy']) && !is_array($mapping['orderBy'])) {
3388
-            throw new InvalidArgumentException("'orderBy' is expected to be an array, not " . gettype($mapping['orderBy']));
3387
+        if (isset($mapping['orderBy']) && ! is_array($mapping['orderBy'])) {
3388
+            throw new InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy']));
3389 3389
         }
3390 3390
     }
3391 3391
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Setup.php 1 patch
Spacing   +6 added lines, -6 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;
6 6
 
@@ -28,14 +28,14 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public static function registerAutoloadDirectory($directory)
30 30
     {
31
-        if (!class_exists('Doctrine\Common\ClassLoader', false)) {
32
-            require_once $directory . "/Doctrine/Common/ClassLoader.php";
31
+        if ( ! class_exists('Doctrine\Common\ClassLoader', false)) {
32
+            require_once $directory."/Doctrine/Common/ClassLoader.php";
33 33
         }
34 34
 
35 35
         $loader = new ClassLoader("Doctrine", $directory);
36 36
         $loader->register();
37 37
 
38
-        $loader = new ClassLoader('Symfony\Component', $directory . "/Doctrine");
38
+        $loader = new ClassLoader('Symfony\Component', $directory."/Doctrine");
39 39
         $loader->register();
40 40
     }
41 41
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         return $config;
102 102
     }
103 103
 
104
-    private static function createCacheConfiguration(bool $isDevMode, string $proxyDir, ?Cache $cache) :  Cache
104
+    private static function createCacheConfiguration(bool $isDevMode, string $proxyDir, ?Cache $cache) : Cache
105 105
     {
106 106
         $cache = self::createCacheInstance($isDevMode, $cache);
107 107
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             $namespace .= ':';
116 116
         }
117 117
 
118
-        $cache->setNamespace($namespace . 'dc2_' . md5($proxyDir) . '_'); // to avoid collisions
118
+        $cache->setNamespace($namespace.'dc2_'.md5($proxyDir).'_'); // to avoid collisions
119 119
 
120 120
         return $cache;
121 121
     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/EntityGenerator.php 1 patch
Spacing   +138 added lines, -138 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;
6 6
 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
      */
330 330
     public function writeEntityClass(ClassMetadata $metadata, $outputDirectory)
331 331
     {
332
-        $path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->getClassName()) . $this->extension;
332
+        $path = $outputDirectory.'/'.str_replace('\\', DIRECTORY_SEPARATOR, $metadata->getClassName()).$this->extension;
333 333
         $dir = dirname($path);
334 334
 
335 335
         if ( ! is_dir($dir)) {
@@ -345,8 +345,8 @@  discard block
 block discarded – undo
345 345
         }
346 346
 
347 347
         if ($this->backupExisting && file_exists($path)) {
348
-            $backupPath = dirname($path) . DIRECTORY_SEPARATOR . basename($path) . "~";
349
-            if (!copy($path, $backupPath)) {
348
+            $backupPath = dirname($path).DIRECTORY_SEPARATOR.basename($path)."~";
349
+            if ( ! copy($path, $backupPath)) {
350 350
                 throw new \RuntimeException("Attempt to backup overwritten entity file but copy operation failed.");
351 351
             }
352 352
         }
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
         $body = str_replace('<spaces>', $this->spaces, $body);
409 409
         $last = strrpos($currentCode, '}');
410 410
 
411
-        return substr($currentCode, 0, $last) . $body . ($body ? "\n" : '') . "}\n";
411
+        return substr($currentCode, 0, $last).$body.($body ? "\n" : '')."}\n";
412 412
     }
413 413
 
414 414
     /**
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
     public function setFieldVisibility($visibility)
473 473
     {
474 474
         if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) {
475
-            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility);
475
+            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility);
476 476
         }
477 477
 
478 478
         $this->fieldVisibility = $visibility;
@@ -569,11 +569,11 @@  discard block
 block discarded – undo
569 569
      */
570 570
     protected function generateEntityNamespace(ClassMetadata $metadata)
571 571
     {
572
-        if (! $this->hasNamespace($metadata)) {
572
+        if ( ! $this->hasNamespace($metadata)) {
573 573
             return '';
574 574
         }
575 575
 
576
-        return 'namespace ' . $this->getNamespace($metadata) .';';
576
+        return 'namespace '.$this->getNamespace($metadata).';';
577 577
     }
578 578
 
579 579
     /**
@@ -595,8 +595,8 @@  discard block
 block discarded – undo
595 595
      */
596 596
     protected function generateEntityClassName(ClassMetadata $metadata)
597 597
     {
598
-        return 'class ' . $this->getClassName($metadata) .
599
-            ($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null);
598
+        return 'class '.$this->getClassName($metadata).
599
+            ($this->extendsClass() ? ' extends '.$this->getClassToExtendName() : null);
600 600
     }
601 601
 
602 602
     /**
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
         $optionalFields = [];
682 682
 
683 683
         foreach ($metadata->getDeclaredPropertiesIterator() as $property) {
684
-            if (! $property->isNullable()) {
684
+            if ( ! $property->isNullable()) {
685 685
                 $requiredFields[] = $property;
686 686
 
687 687
                 continue;
@@ -710,13 +710,13 @@  discard block
 block discarded – undo
710 710
             $fieldName  = $property->getName();
711 711
             $fieldType  = $property->getTypeName();
712 712
             $mappedType = $this->getType($fieldType);
713
-            $param      = '$' . $fieldName;
713
+            $param      = '$'.$fieldName;
714 714
 
715
-            $paramTypes[] = $mappedType . ($property->isNullable() ? '|null' : '');
715
+            $paramTypes[] = $mappedType.($property->isNullable() ? '|null' : '');
716 716
             $paramVariables[] = $param;
717 717
 
718 718
             if ($fieldType === 'datetime') {
719
-                $param = $mappedType . ' ' . $param;
719
+                $param = $mappedType.' '.$param;
720 720
             }
721 721
 
722 722
             if ($property->isNullable()) {
@@ -725,13 +725,13 @@  discard block
 block discarded – undo
725 725
 
726 726
             $params[] = $param;
727 727
 
728
-            $fields[] = '$this->' . $fieldName . ' = $' . $fieldName . ';';
728
+            $fields[] = '$this->'.$fieldName.' = $'.$fieldName.';';
729 729
         }
730 730
 
731 731
         $maxParamTypeLength = max(array_map('strlen', $paramTypes));
732 732
         $paramTags = array_map(
733
-            function ($type, $variable) use ($maxParamTypeLength) {
734
-                return '@param ' . $type . str_repeat(' ', $maxParamTypeLength - strlen($type) + 1) . $variable;
733
+            function($type, $variable) use ($maxParamTypeLength) {
734
+                return '@param '.$type.str_repeat(' ', $maxParamTypeLength - strlen($type) + 1).$variable;
735 735
             },
736 736
             $paramTypes,
737 737
             $paramVariables
@@ -739,8 +739,8 @@  discard block
 block discarded – undo
739 739
 
740 740
         // Generate multi line constructor if the signature exceeds 120 characters.
741 741
         if (array_sum(array_map('strlen', $params)) + count($params) * 2 + 29 > 120) {
742
-            $delimiter = "\n" . $this->spaces;
743
-            $params = $delimiter . implode(',' . $delimiter, $params) . "\n";
742
+            $delimiter = "\n".$this->spaces;
743
+            $params = $delimiter.implode(','.$delimiter, $params)."\n";
744 744
         } else {
745 745
             $params = implode(', ', $params);
746 746
         }
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
         $replacements = [
749 749
             '<paramTags>' => implode("\n * ", $paramTags),
750 750
             '<params>'    => $params,
751
-            '<fields>'    => implode("\n" . $this->spaces, $fields),
751
+            '<fields>'    => implode("\n".$this->spaces, $fields),
752 752
         ];
753 753
 
754 754
         $constructor = str_replace(
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
 
794 794
             if ($inClass) {
795 795
                 $inClass = false;
796
-                $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1];
796
+                $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1];
797 797
                 $this->staticReflection[$lastSeenClass]['properties'] = [];
798 798
                 $this->staticReflection[$lastSeenClass]['methods'] = [];
799 799
             }
@@ -801,16 +801,16 @@  discard block
 block discarded – undo
801 801
             if (T_NAMESPACE === $token[0]) {
802 802
                 $lastSeenNamespace = '';
803 803
                 $inNamespace = true;
804
-            } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i-1][0]) {
804
+            } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i - 1][0]) {
805 805
                 $inClass = true;
806 806
             } elseif (T_FUNCTION === $token[0]) {
807
-                if (T_STRING === $tokens[$i+2][0]) {
808
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]);
809
-                } elseif ($tokens[$i+2] == '&' && T_STRING === $tokens[$i+3][0]) {
810
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]);
807
+                if (T_STRING === $tokens[$i + 2][0]) {
808
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]);
809
+                } elseif ($tokens[$i + 2] == '&' && T_STRING === $tokens[$i + 3][0]) {
810
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]);
811 811
                 }
812
-            } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i+2][0]) {
813
-                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1);
812
+            } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i + 2][0]) {
813
+                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1);
814 814
             }
815 815
         }
816 816
     }
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
      */
824 824
     protected function hasProperty($property, ClassMetadata $metadata)
825 825
     {
826
-        if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->getClassName()))) {
826
+        if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->getClassName()))) {
827 827
             // don't generate property if its already on the base class.
828 828
             $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->getClassName());
829 829
 
@@ -853,7 +853,7 @@  discard block
 block discarded – undo
853 853
      */
854 854
     protected function hasMethod($method, ClassMetadata $metadata)
855 855
     {
856
-        if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->getClassName()))) {
856
+        if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->getClassName()))) {
857 857
             // don't generate method if its already on the base class.
858 858
             $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->getClassName());
859 859
 
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
      */
885 885
     protected function getTraits(ClassMetadata $metadata)
886 886
     {
887
-        if (! ($metadata->getReflectionClass() !== null || class_exists($metadata->getClassName()))) {
887
+        if ( ! ($metadata->getReflectionClass() !== null || class_exists($metadata->getClassName()))) {
888 888
             return [];
889 889
         }
890 890
 
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
     {
934 934
         $refl = new \ReflectionClass($this->getClassToExtend());
935 935
 
936
-        return '\\' . $refl->getName();
936
+        return '\\'.$refl->getName();
937 937
     }
938 938
 
939 939
     /**
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
     {
967 967
         $lines = [];
968 968
         $lines[] = '/**';
969
-        $lines[] = ' * ' . $this->getClassName($metadata);
969
+        $lines[] = ' * '.$this->getClassName($metadata);
970 970
 
971 971
         if ($this->generateAnnotations) {
972 972
             $lines[] = ' *';
@@ -982,12 +982,12 @@  discard block
 block discarded – undo
982 982
 
983 983
             foreach ($methods as $method) {
984 984
                 if ($code = $this->$method($metadata)) {
985
-                    $lines[] = ' * ' . $code;
985
+                    $lines[] = ' * '.$code;
986 986
                 }
987 987
             }
988 988
 
989 989
             if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) {
990
-                $lines[] = ' * @' . $this->annotationsPrefix . 'HasLifecycleCallbacks';
990
+                $lines[] = ' * @'.$this->annotationsPrefix.'HasLifecycleCallbacks';
991 991
             }
992 992
         }
993 993
 
@@ -1003,17 +1003,17 @@  discard block
 block discarded – undo
1003 1003
      */
1004 1004
     protected function generateEntityAnnotation(ClassMetadata $metadata)
1005 1005
     {
1006
-        $prefix = '@' . $this->annotationsPrefix;
1006
+        $prefix = '@'.$this->annotationsPrefix;
1007 1007
 
1008 1008
         if ($metadata->isEmbeddedClass) {
1009
-            return $prefix . 'Embeddable';
1009
+            return $prefix.'Embeddable';
1010 1010
         }
1011 1011
 
1012 1012
         $customRepository = $metadata->getCustomRepositoryClassName()
1013
-            ? '(repositoryClass="' . $metadata->getCustomRepositoryClassName() . '")'
1013
+            ? '(repositoryClass="'.$metadata->getCustomRepositoryClassName().'")'
1014 1014
             : '';
1015 1015
 
1016
-        return $prefix . ($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity') . $customRepository;
1016
+        return $prefix.($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity').$customRepository;
1017 1017
     }
1018 1018
 
1019 1019
     /**
@@ -1030,28 +1030,28 @@  discard block
 block discarded – undo
1030 1030
         $table = [];
1031 1031
 
1032 1032
         if ($metadata->table->getSchema()) {
1033
-            $table[] = 'schema="' . $metadata->table->getSchema() . '"';
1033
+            $table[] = 'schema="'.$metadata->table->getSchema().'"';
1034 1034
         }
1035 1035
 
1036 1036
         if ($metadata->table->getName()) {
1037
-            $table[] = 'name="' . $metadata->table->getName() . '"';
1037
+            $table[] = 'name="'.$metadata->table->getName().'"';
1038 1038
         }
1039 1039
 
1040 1040
         if ($metadata->table->getOptions()) {
1041
-            $table[] = 'options={' . $this->exportTableOptions($metadata->table->getOptions()) . '}';
1041
+            $table[] = 'options={'.$this->exportTableOptions($metadata->table->getOptions()).'}';
1042 1042
         }
1043 1043
 
1044 1044
         if ($metadata->table->getUniqueConstraints()) {
1045 1045
             $constraints = $this->generateTableConstraints('UniqueConstraint', $metadata->table->getUniqueConstraints());
1046
-            $table[] = 'uniqueConstraints={' . $constraints . '}';
1046
+            $table[] = 'uniqueConstraints={'.$constraints.'}';
1047 1047
         }
1048 1048
 
1049 1049
         if ($metadata->table->getIndexes()) {
1050 1050
             $constraints = $this->generateTableConstraints('Index', $metadata->table->getIndexes());
1051
-            $table[] = 'indexes={' . $constraints . '}';
1051
+            $table[] = 'indexes={'.$constraints.'}';
1052 1052
         }
1053 1053
 
1054
-        return '@' . $this->annotationsPrefix . 'Table(' . implode(', ', $table) . ')';
1054
+        return '@'.$this->annotationsPrefix.'Table('.implode(', ', $table).')';
1055 1055
     }
1056 1056
 
1057 1057
     /**
@@ -1068,10 +1068,10 @@  discard block
 block discarded – undo
1068 1068
             $columns = [];
1069 1069
 
1070 1070
             foreach ($constraint['columns'] as $column) {
1071
-                $columns[] = '"' . $column . '"';
1071
+                $columns[] = '"'.$column.'"';
1072 1072
             }
1073 1073
 
1074
-            $annotations[] = '@' . $this->annotationsPrefix . $constraintName . '(name="' . $name . '", columns={' . implode(', ', $columns) . '})';
1074
+            $annotations[] = '@'.$this->annotationsPrefix.$constraintName.'(name="'.$name.'", columns={'.implode(', ', $columns).'})';
1075 1075
         }
1076 1076
 
1077 1077
         return implode(', ', $annotations);
@@ -1085,7 +1085,7 @@  discard block
 block discarded – undo
1085 1085
     protected function generateInheritanceAnnotation(ClassMetadata $metadata)
1086 1086
     {
1087 1087
         if ($metadata->inheritanceType !== InheritanceType::NONE) {
1088
-            return '@' . $this->annotationsPrefix . 'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")';
1088
+            return '@'.$this->annotationsPrefix.'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")';
1089 1089
         }
1090 1090
     }
1091 1091
 
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
                 $discrColumn->getLength()
1107 1107
             );
1108 1108
 
1109
-            return '@' . $this->annotationsPrefix . 'DiscriminatorColumn(' . $columnDefinition . ')';
1109
+            return '@'.$this->annotationsPrefix.'DiscriminatorColumn('.$columnDefinition.')';
1110 1110
         }
1111 1111
     }
1112 1112
 
@@ -1121,10 +1121,10 @@  discard block
 block discarded – undo
1121 1121
             $inheritanceClassMap = [];
1122 1122
 
1123 1123
             foreach ($metadata->discriminatorMap as $type => $class) {
1124
-                $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"';
1124
+                $inheritanceClassMap[] .= '"'.$type.'" = "'.$class.'"';
1125 1125
             }
1126 1126
 
1127
-            return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})';
1127
+            return '@'.$this->annotationsPrefix.'DiscriminatorMap({'.implode(', ', $inheritanceClassMap).'})';
1128 1128
         }
1129 1129
     }
1130 1130
 
@@ -1155,7 +1155,7 @@  discard block
 block discarded – undo
1155 1155
 
1156 1156
         foreach ($metadata->getDeclaredPropertiesIterator() as $fieldName => $property) {
1157 1157
             if ($property instanceof FieldMetadata) {
1158
-                $nullable  = $property->isNullable() ? 'null' : null;
1158
+                $nullable = $property->isNullable() ? 'null' : null;
1159 1159
 
1160 1160
                 if ($code = $this->generateEntityStubMethod($metadata, 'get', $fieldName, $property->getTypeName(), $nullable)) {
1161 1161
                     $methods[] = $code;
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
         ;
1212 1212
 
1213 1213
         foreach ($joinColumns as $joinColumn) {
1214
-            if (! $joinColumn->isNullable()) {
1214
+            if ( ! $joinColumn->isNullable()) {
1215 1215
                 return false;
1216 1216
             }
1217 1217
         }
@@ -1260,7 +1260,7 @@  discard block
 block discarded – undo
1260 1260
 
1261 1261
             if ($property instanceof FieldMetadata) {
1262 1262
                 $options      = $property->getOptions();
1263
-                $defaultValue = isset($options['default']) ? ' = ' . var_export($options['default'], true) : null;
1263
+                $defaultValue = isset($options['default']) ? ' = '.var_export($options['default'], true) : null;
1264 1264
 
1265 1265
                 $lines[] = $this->generateFieldMappingPropertyDocBlock($property, $metadata);
1266 1266
             } else {
@@ -1269,7 +1269,7 @@  discard block
 block discarded – undo
1269 1269
                 $lines[] = $this->generateAssociationMappingPropertyDocBlock($property, $metadata);
1270 1270
             }
1271 1271
 
1272
-            $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldName . $defaultValue . ";\n";
1272
+            $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldName.$defaultValue.";\n";
1273 1273
         }
1274 1274
 
1275 1275
         return implode("\n", $lines);
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
      */
1308 1308
     protected function generateEntityStubMethod(ClassMetadata $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null)
1309 1309
     {
1310
-        $methodName = $type . Inflector::classify($fieldName);
1310
+        $methodName = $type.Inflector::classify($fieldName);
1311 1311
         $variableName = Inflector::camelize($fieldName);
1312 1312
 
1313 1313
         if (in_array($type, ["add", "remove"])) {
@@ -1328,18 +1328,18 @@  discard block
 block discarded – undo
1328 1328
         $variableType   = $typeHint ? $this->getType($typeHint) : null;
1329 1329
 
1330 1330
         if ($typeHint && ! isset($types[$typeHint])) {
1331
-            $variableType   =  '\\' . ltrim($variableType, '\\');
1332
-            $methodTypeHint =  '\\' . $typeHint . ' ';
1331
+            $variableType   = '\\'.ltrim($variableType, '\\');
1332
+            $methodTypeHint = '\\'.$typeHint.' ';
1333 1333
         }
1334 1334
 
1335 1335
         $replacements = [
1336
-          '<description>'       => ucfirst($type) . ' ' . $variableName . '.',
1336
+          '<description>'       => ucfirst($type).' '.$variableName.'.',
1337 1337
           '<methodTypeHint>'    => $methodTypeHint,
1338
-          '<variableType>'      => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''),
1338
+          '<variableType>'      => $variableType.(null !== $defaultValue ? ('|'.$defaultValue) : ''),
1339 1339
           '<variableName>'      => $variableName,
1340 1340
           '<methodName>'        => $methodName,
1341 1341
           '<fieldName>'         => $fieldName,
1342
-          '<variableDefault>'   => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '',
1342
+          '<variableDefault>'   => ($defaultValue !== null) ? (' = '.$defaultValue) : '',
1343 1343
           '<entity>'            => $this->getClassName($metadata)
1344 1344
         ];
1345 1345
 
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
         $this->staticReflection[$metadata->getClassName()]['methods'][] = $methodName;
1369 1369
 
1370 1370
         $replacements = [
1371
-            '<name>'        => $this->annotationsPrefix . ucfirst($name),
1371
+            '<name>'        => $this->annotationsPrefix.ucfirst($name),
1372 1372
             '<methodName>'  => $methodName,
1373 1373
         ];
1374 1374
 
@@ -1388,25 +1388,25 @@  discard block
 block discarded – undo
1388 1388
      */
1389 1389
     protected function generateIdentifierAnnotation(Property $metadata)
1390 1390
     {
1391
-        $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id';
1391
+        $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id';
1392 1392
 
1393 1393
         if ($metadata instanceof FieldMetadata) {
1394 1394
             if ($generatorType = $this->getIdGeneratorTypeString($metadata->getValueGenerator()->getType())) {
1395
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")';
1395
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")';
1396 1396
             }
1397 1397
 
1398 1398
             if ($metadata->getValueGenerator()->getType()) {
1399 1399
                 $generator = [];
1400 1400
 
1401 1401
                 if (isset($metadata->getValueGenerator()->getDefinition()['sequenceName'])) {
1402
-                    $generator[] = 'sequenceName="' . $metadata->getValueGenerator()->getDefinition()['sequenceName'] . '"';
1402
+                    $generator[] = 'sequenceName="'.$metadata->getValueGenerator()->getDefinition()['sequenceName'].'"';
1403 1403
                 }
1404 1404
 
1405 1405
                 if (isset($metadata->getValueGenerator()->getDefinition()['allocationSize'])) {
1406
-                    $generator[] = 'allocationSize=' . $metadata->getValueGenerator()->getDefinition()['allocationSize'];
1406
+                    $generator[] = 'allocationSize='.$metadata->getValueGenerator()->getDefinition()['allocationSize'];
1407 1407
                 }
1408 1408
 
1409
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'SequenceGenerator(' . implode(', ', $generator) . ')';
1409
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'SequenceGenerator('.implode(', ', $generator).')';
1410 1410
             }
1411 1411
         }
1412 1412
 
@@ -1422,34 +1422,34 @@  discard block
 block discarded – undo
1422 1422
     {
1423 1423
         $lines            = [];
1424 1424
         $joinTableAnnot   = [];
1425
-        $joinTableAnnot[] = 'name="' . $joinTable->getName() . '"';
1425
+        $joinTableAnnot[] = 'name="'.$joinTable->getName().'"';
1426 1426
 
1427
-        if (! empty($joinTable->getSchema())) {
1428
-            $joinTableAnnot[] = 'schema="' . $joinTable->getSchema() . '"';
1427
+        if ( ! empty($joinTable->getSchema())) {
1428
+            $joinTableAnnot[] = 'schema="'.$joinTable->getSchema().'"';
1429 1429
         }
1430 1430
 
1431
-        $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinTable(' . implode(', ', $joinTableAnnot) . ',';
1432
-        $lines[] = $this->spaces . ' *   joinColumns={';
1431
+        $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinTable('.implode(', ', $joinTableAnnot).',';
1432
+        $lines[] = $this->spaces.' *   joinColumns={';
1433 1433
 
1434 1434
         $joinColumnsLines = [];
1435 1435
 
1436 1436
         foreach ($joinTable->getJoinColumns() as $joinColumn) {
1437
-            $joinColumnsLines[] = $this->spaces . ' *     ' . $this->generateJoinColumnAnnotation($joinColumn);
1437
+            $joinColumnsLines[] = $this->spaces.' *     '.$this->generateJoinColumnAnnotation($joinColumn);
1438 1438
         }
1439 1439
 
1440
-        $lines[] = implode(",". PHP_EOL, $joinColumnsLines);
1441
-        $lines[] = $this->spaces . ' *   },';
1442
-        $lines[] = $this->spaces . ' *   inverseJoinColumns={';
1440
+        $lines[] = implode(",".PHP_EOL, $joinColumnsLines);
1441
+        $lines[] = $this->spaces.' *   },';
1442
+        $lines[] = $this->spaces.' *   inverseJoinColumns={';
1443 1443
 
1444 1444
         $inverseJoinColumnsLines = [];
1445 1445
 
1446 1446
         foreach ($joinTable->getInverseJoinColumns() as $joinColumn) {
1447
-            $inverseJoinColumnsLines[] = $this->spaces . ' *     ' . $this->generateJoinColumnAnnotation($joinColumn);
1447
+            $inverseJoinColumnsLines[] = $this->spaces.' *     '.$this->generateJoinColumnAnnotation($joinColumn);
1448 1448
         }
1449 1449
 
1450
-        $lines[] = implode(",". PHP_EOL, $inverseJoinColumnsLines);
1451
-        $lines[] = $this->spaces . ' *   }';
1452
-        $lines[] = $this->spaces . ' * )';
1450
+        $lines[] = implode(",".PHP_EOL, $inverseJoinColumnsLines);
1451
+        $lines[] = $this->spaces.' *   }';
1452
+        $lines[] = $this->spaces.' * )';
1453 1453
 
1454 1454
         return implode(PHP_EOL, $lines);
1455 1455
     }
@@ -1463,23 +1463,23 @@  discard block
 block discarded – undo
1463 1463
     {
1464 1464
         $joinColumnAnnot = [];
1465 1465
 
1466
-        $joinColumnAnnot[] = 'name="' . $joinColumn->getColumnName() . '"';
1467
-        $joinColumnAnnot[] = 'referencedColumnName="' . $joinColumn->getReferencedColumnName() . '"';
1466
+        $joinColumnAnnot[] = 'name="'.$joinColumn->getColumnName().'"';
1467
+        $joinColumnAnnot[] = 'referencedColumnName="'.$joinColumn->getReferencedColumnName().'"';
1468 1468
 
1469 1469
         if ($joinColumn->isUnique()) {
1470 1470
             $joinColumnAnnot[] = 'unique=true';
1471 1471
         }
1472 1472
 
1473
-        if (!$joinColumn->isNullable()) {
1473
+        if ( ! $joinColumn->isNullable()) {
1474 1474
             $joinColumnAnnot[] = 'nullable=false';
1475 1475
         }
1476 1476
 
1477
-        if (!empty($joinColumn->getOnDelete())) {
1478
-            $joinColumnAnnot[] = 'onDelete="' . $joinColumn->getOnDelete() . '"';
1477
+        if ( ! empty($joinColumn->getOnDelete())) {
1478
+            $joinColumnAnnot[] = 'onDelete="'.$joinColumn->getOnDelete().'"';
1479 1479
         }
1480 1480
 
1481 1481
         if ($joinColumn->getColumnDefinition()) {
1482
-            $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn->getColumnDefinition() . '"';
1482
+            $joinColumnAnnot[] = 'columnDefinition="'.$joinColumn->getColumnDefinition().'"';
1483 1483
         }
1484 1484
 
1485 1485
         $options = [];
@@ -1494,7 +1494,7 @@  discard block
 block discarded – undo
1494 1494
             $joinColumnAnnot[] = 'options={'.implode(',', $options).'}';
1495 1495
         }
1496 1496
 
1497
-        return '@' . $this->annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')';
1497
+        return '@'.$this->annotationsPrefix.'JoinColumn('.implode(', ', $joinColumnAnnot).')';
1498 1498
     }
1499 1499
 
1500 1500
     /**
@@ -1506,16 +1506,16 @@  discard block
 block discarded – undo
1506 1506
     protected function generateAssociationMappingPropertyDocBlock(AssociationMetadata $association, ClassMetadata $metadata)
1507 1507
     {
1508 1508
         $lines = [];
1509
-        $lines[] = $this->spaces . '/**';
1509
+        $lines[] = $this->spaces.'/**';
1510 1510
 
1511 1511
         if ($association instanceof ToManyAssociationMetadata) {
1512
-            $lines[] = $this->spaces . ' * @var \Doctrine\Common\Collections\Collection';
1512
+            $lines[] = $this->spaces.' * @var \Doctrine\Common\Collections\Collection';
1513 1513
         } else {
1514
-            $lines[] = $this->spaces . ' * @var \\' . ltrim($association->getTargetEntity(), '\\');
1514
+            $lines[] = $this->spaces.' * @var \\'.ltrim($association->getTargetEntity(), '\\');
1515 1515
         }
1516 1516
 
1517 1517
         if ($this->generateAnnotations) {
1518
-            $lines[] = $this->spaces . ' *';
1518
+            $lines[] = $this->spaces.' *';
1519 1519
 
1520 1520
             if ($association->isPrimaryKey()) {
1521 1521
                 $lines[] = $this->generateIdentifierAnnotation($association);
@@ -1535,18 +1535,18 @@  discard block
 block discarded – undo
1535 1535
 
1536 1536
             $typeOptions = [];
1537 1537
 
1538
-            $typeOptions[] = 'targetEntity="' . $association->getTargetEntity() . '"';
1538
+            $typeOptions[] = 'targetEntity="'.$association->getTargetEntity().'"';
1539 1539
 
1540 1540
             if ($association->getMappedBy()) {
1541
-                $typeOptions[] = 'mappedBy="' . $association->getMappedBy() . '"';
1541
+                $typeOptions[] = 'mappedBy="'.$association->getMappedBy().'"';
1542 1542
             }
1543 1543
 
1544 1544
             if ($association->getInversedBy()) {
1545
-                $typeOptions[] = 'inversedBy="' . $association->getInversedBy() . '"';
1545
+                $typeOptions[] = 'inversedBy="'.$association->getInversedBy().'"';
1546 1546
             }
1547 1547
 
1548 1548
             if ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy()) {
1549
-                $typeOptions[] = 'indexBy="' . $association->getIndexedBy() . '"';
1549
+                $typeOptions[] = 'indexBy="'.$association->getIndexedBy().'"';
1550 1550
             }
1551 1551
 
1552 1552
             if ($association->isOrphanRemoval()) {
@@ -1566,28 +1566,28 @@  discard block
 block discarded – undo
1566 1566
                     $cascades = ['"all"'];
1567 1567
                 }
1568 1568
 
1569
-                $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}';
1569
+                $typeOptions[] = 'cascade={'.implode(',', $cascades).'}';
1570 1570
             }
1571 1571
 
1572 1572
             if ($association->getFetchMode() !== FetchMode::LAZY) {
1573
-                $typeOptions[] = 'fetch="' . $association->getFetchMode() . '"';
1573
+                $typeOptions[] = 'fetch="'.$association->getFetchMode().'"';
1574 1574
             }
1575 1575
 
1576
-            $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')';
1576
+            $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.''.$type.'('.implode(', ', $typeOptions).')';
1577 1577
 
1578 1578
             if ($association instanceof ToOneAssociationMetadata && $association->getJoinColumns()) {
1579
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinColumns({';
1579
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinColumns({';
1580 1580
 
1581 1581
                 $joinColumnsLines = [];
1582 1582
 
1583 1583
                 foreach ($association->getJoinColumns() as $joinColumn) {
1584 1584
                     if ($joinColumnAnnot = $this->generateJoinColumnAnnotation($joinColumn)) {
1585
-                        $joinColumnsLines[] = $this->spaces . ' *   ' . $joinColumnAnnot;
1585
+                        $joinColumnsLines[] = $this->spaces.' *   '.$joinColumnAnnot;
1586 1586
                     }
1587 1587
                 }
1588 1588
 
1589 1589
                 $lines[] = implode(",\n", $joinColumnsLines);
1590
-                $lines[] = $this->spaces . ' * })';
1590
+                $lines[] = $this->spaces.' * })';
1591 1591
             }
1592 1592
 
1593 1593
             if ($association instanceof ToManyAssociationMetadata) {
@@ -1596,20 +1596,20 @@  discard block
 block discarded – undo
1596 1596
                 }
1597 1597
 
1598 1598
                 if ($association->getOrderBy()) {
1599
-                    $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'OrderBy({';
1599
+                    $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'OrderBy({';
1600 1600
                     $orderBy = [];
1601 1601
 
1602 1602
                     foreach ($association->getOrderBy() as $name => $direction) {
1603
-                        $orderBy[] = $this->spaces . ' *     "' . $name . '"="' . $direction . '"';
1603
+                        $orderBy[] = $this->spaces.' *     "'.$name.'"="'.$direction.'"';
1604 1604
                     }
1605 1605
 
1606
-                    $lines[] = implode(',' . PHP_EOL, $orderBy);
1607
-                    $lines[] = $this->spaces . ' * })';
1606
+                    $lines[] = implode(','.PHP_EOL, $orderBy);
1607
+                    $lines[] = $this->spaces.' * })';
1608 1608
                 }
1609 1609
             }
1610 1610
         }
1611 1611
 
1612
-        $lines[] = $this->spaces . ' */';
1612
+        $lines[] = $this->spaces.' */';
1613 1613
 
1614 1614
         return implode("\n", $lines);
1615 1615
     }
@@ -1626,49 +1626,49 @@  discard block
 block discarded – undo
1626 1626
 
1627 1627
         $lines = [];
1628 1628
 
1629
-        $lines[] = $this->spaces . '/**';
1630
-        $lines[] = $this->spaces . ' * @var '
1629
+        $lines[] = $this->spaces.'/**';
1630
+        $lines[] = $this->spaces.' * @var '
1631 1631
             . $this->getType($fieldType)
1632 1632
             . ($propertyMetadata->isNullable() ? '|null' : '');
1633 1633
 
1634 1634
         if ($this->generateAnnotations) {
1635 1635
             $column  = [];
1636
-            $lines[] = $this->spaces . ' *';
1636
+            $lines[] = $this->spaces.' *';
1637 1637
 
1638 1638
             if ($propertyMetadata->getColumnName()) {
1639
-                $column[] = 'name="' . $propertyMetadata->getColumnName() . '"';
1639
+                $column[] = 'name="'.$propertyMetadata->getColumnName().'"';
1640 1640
             }
1641 1641
 
1642
-            $column[] = 'type="' . $fieldType . '"';
1642
+            $column[] = 'type="'.$fieldType.'"';
1643 1643
 
1644 1644
             if (is_int($propertyMetadata->getLength())) {
1645
-                $column[] = 'length=' . $propertyMetadata->getLength();
1645
+                $column[] = 'length='.$propertyMetadata->getLength();
1646 1646
             }
1647 1647
 
1648 1648
             if (is_int($propertyMetadata->getPrecision())) {
1649
-                $column[] = 'precision=' .  $propertyMetadata->getPrecision();
1649
+                $column[] = 'precision='.$propertyMetadata->getPrecision();
1650 1650
             }
1651 1651
 
1652 1652
             if (is_int($propertyMetadata->getScale())) {
1653
-                $column[] = 'scale=' .  $propertyMetadata->getScale();
1653
+                $column[] = 'scale='.$propertyMetadata->getScale();
1654 1654
             }
1655 1655
 
1656 1656
             if ($propertyMetadata->isNullable()) {
1657
-                $column[] = 'nullable=' .  var_export($propertyMetadata->isNullable(), true);
1657
+                $column[] = 'nullable='.var_export($propertyMetadata->isNullable(), true);
1658 1658
             }
1659 1659
 
1660 1660
             if ($propertyMetadata->isUnique()) {
1661
-                $column[] = 'unique=' . var_export($propertyMetadata->isUnique(), true);
1661
+                $column[] = 'unique='.var_export($propertyMetadata->isUnique(), true);
1662 1662
             }
1663 1663
 
1664 1664
             if ($propertyMetadata->getColumnDefinition()) {
1665
-                $column[] = 'columnDefinition="' . $propertyMetadata->getColumnDefinition() . '"';
1665
+                $column[] = 'columnDefinition="'.$propertyMetadata->getColumnDefinition().'"';
1666 1666
             }
1667 1667
 
1668 1668
             $options = [];
1669 1669
 
1670 1670
             if (isset($fieldMapping['options']['default']) && $fieldMapping['options']['default']) {
1671
-                $options[] = '"default"="' . $fieldMapping['options']['default'] .'"';
1671
+                $options[] = '"default"="'.$fieldMapping['options']['default'].'"';
1672 1672
             }
1673 1673
 
1674 1674
             if (isset($fieldMapping['options']['unsigned']) && $fieldMapping['options']['unsigned']) {
@@ -1680,33 +1680,33 @@  discard block
 block discarded – undo
1680 1680
             }
1681 1681
 
1682 1682
             if (isset($fieldMapping['options']['comment']) && $fieldMapping['options']['comment']) {
1683
-                $options[] = '"comment"="' . $fieldMapping['options']['comment'] .'"';
1683
+                $options[] = '"comment"="'.$fieldMapping['options']['comment'].'"';
1684 1684
             }
1685 1685
 
1686 1686
             if (isset($fieldMapping['options']['collation']) && $fieldMapping['options']['collation']) {
1687
-                $options[] = '"collation"="' . $fieldMapping['options']['collation'] .'"';
1687
+                $options[] = '"collation"="'.$fieldMapping['options']['collation'].'"';
1688 1688
             }
1689 1689
 
1690 1690
             if (isset($fieldMapping['options']['check']) && $fieldMapping['options']['check']) {
1691
-                $options[] = '"check"="' . $fieldMapping['options']['check'] .'"';
1691
+                $options[] = '"check"="'.$fieldMapping['options']['check'].'"';
1692 1692
             }
1693 1693
 
1694 1694
             if ($options) {
1695 1695
                 $column[] = 'options={'.implode(',', $options).'}';
1696 1696
             }
1697 1697
 
1698
-            $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Column(' . implode(', ', $column) . ')';
1698
+            $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Column('.implode(', ', $column).')';
1699 1699
 
1700 1700
             if ($propertyMetadata->isPrimaryKey()) {
1701 1701
                 $lines[] = $this->generateIdentifierAnnotation($propertyMetadata);
1702 1702
             }
1703 1703
 
1704 1704
             if ($metadata->isVersioned() && $metadata->versionProperty->getName() === $propertyMetadata->getName()) {
1705
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Version';
1705
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Version';
1706 1706
             }
1707 1707
         }
1708 1708
 
1709
-        $lines[] = $this->spaces . ' */';
1709
+        $lines[] = $this->spaces.' */';
1710 1710
 
1711 1711
         return implode("\n", $lines);
1712 1712
     }
@@ -1719,27 +1719,27 @@  discard block
 block discarded – undo
1719 1719
     protected function generateEmbeddedPropertyDocBlock(array $embeddedClass)
1720 1720
     {
1721 1721
         $lines = [];
1722
-        $lines[] = $this->spaces . '/**';
1723
-        $lines[] = $this->spaces . ' * @var \\' . ltrim($embeddedClass['class'], '\\');
1722
+        $lines[] = $this->spaces.'/**';
1723
+        $lines[] = $this->spaces.' * @var \\'.ltrim($embeddedClass['class'], '\\');
1724 1724
 
1725 1725
         if ($this->generateAnnotations) {
1726
-            $lines[] = $this->spaces . ' *';
1726
+            $lines[] = $this->spaces.' *';
1727 1727
 
1728
-            $embedded = ['class="' . $embeddedClass['class'] . '"'];
1728
+            $embedded = ['class="'.$embeddedClass['class'].'"'];
1729 1729
 
1730 1730
             if (isset($embeddedClass['columnPrefix'])) {
1731 1731
                 if (is_string($embeddedClass['columnPrefix'])) {
1732
-                    $embedded[] = 'columnPrefix="' . $embeddedClass['columnPrefix'] . '"';
1732
+                    $embedded[] = 'columnPrefix="'.$embeddedClass['columnPrefix'].'"';
1733 1733
                 } else {
1734
-                    $embedded[] = 'columnPrefix=' . var_export($embeddedClass['columnPrefix'], true);
1734
+                    $embedded[] = 'columnPrefix='.var_export($embeddedClass['columnPrefix'], true);
1735 1735
                 }
1736 1736
             }
1737 1737
 
1738
-            $lines[] = $this->spaces . ' * @' .
1739
-                $this->annotationsPrefix . 'Embedded(' . implode(', ', $embedded) . ')';
1738
+            $lines[] = $this->spaces.' * @'.
1739
+                $this->annotationsPrefix.'Embedded('.implode(', ', $embedded).')';
1740 1740
         }
1741 1741
 
1742
-        $lines[] = $this->spaces . ' */';
1742
+        $lines[] = $this->spaces.' */';
1743 1743
 
1744 1744
         return implode("\n", $lines);
1745 1745
     }
@@ -1753,13 +1753,13 @@  discard block
 block discarded – undo
1753 1753
         $processedClasses = [];
1754 1754
         foreach ($metadata->entityListeners as $event => $eventListeners) {
1755 1755
             foreach ($eventListeners as $eventListener) {
1756
-                $processedClasses[] = '"' . $eventListener['class'] . '"';
1756
+                $processedClasses[] = '"'.$eventListener['class'].'"';
1757 1757
             }
1758 1758
         }
1759 1759
 
1760 1760
         return \sprintf(
1761 1761
             '%s%s({%s})',
1762
-            '@' . $this->annotationsPrefix,
1762
+            '@'.$this->annotationsPrefix,
1763 1763
             'EntityListeners',
1764 1764
             \implode(',', \array_unique($processedClasses))
1765 1765
         );
@@ -1777,7 +1777,7 @@  discard block
 block discarded – undo
1777 1777
 
1778 1778
         foreach ($lines as $key => $value) {
1779 1779
             if ( ! empty($value)) {
1780
-                $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key];
1780
+                $lines[$key] = str_repeat($this->spaces, $num).$lines[$key];
1781 1781
             }
1782 1782
         }
1783 1783
 
@@ -1845,8 +1845,8 @@  discard block
 block discarded – undo
1845 1845
 
1846 1846
         foreach ($options as $name => $option) {
1847 1847
             $optionValue = is_array($option)
1848
-                ? '{' . $this->exportTableOptions($option) . '}'
1849
-                : '"' . (string) $option . '"'
1848
+                ? '{'.$this->exportTableOptions($option).'}'
1849
+                : '"'.(string) $option.'"'
1850 1850
             ;
1851 1851
 
1852 1852
             $optionsStr[] = sprintf('"%s"=%s', $name, $optionValue);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 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
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php 1 patch
Spacing   +6 added lines, -6 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
 
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
 
164 164
         $matches = array_filter(
165 165
             $this->getMappedEntities($entityManager),
166
-            function ($mappedEntity) use ($entityName) {
167
-                return preg_match('{' . preg_quote($entityName) . '}', $mappedEntity);
166
+            function($mappedEntity) use ($entityName) {
167
+                return preg_match('{'.preg_quote($entityName).'}', $mappedEntity);
168 168
             }
169 169
         );
170 170
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
             $output[] = $this->formatField(
223 223
                 sprintf('  %s', $parentClass->getParent()),
224
-                ($parentClass->isRootEntity() ? '(Root) ' : '') . $this->formatValue($attributes)
224
+                ($parentClass->isRootEntity() ? '(Root) ' : '').$this->formatValue($attributes)
225 225
             );
226 226
         }
227 227
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         }
247 247
 
248 248
         if (is_bool($value)) {
249
-            return '<comment>' . ($value ? 'True' : 'False') . '</comment>';
249
+            return '<comment>'.($value ? 'True' : 'False').'</comment>';
250 250
         }
251 251
 
252 252
         if (empty($value)) {
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 
325 325
             if ($property instanceof FieldMetadata) {
326 326
                 $output = array_merge($output, $this->formatColumn($property));
327
-            }  else if ($property instanceof AssociationMetadata) {
327
+            } else if ($property instanceof AssociationMetadata) {
328 328
                 // @todo guilhermeblanco Fix me! We are trying to iterate through an AssociationMetadata instance
329 329
                 foreach ($property as $field => $value) {
330 330
                     $output[] = $this->formatField(sprintf('    %s', $field), $this->formatValue($value));
Please login to merge, or discard this patch.
Doctrine/ORM/Tools/Console/Command/ClearCache/CollectionRegionCommand.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\Tools\Console\Command\ClearCache;
6 6
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
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/Persisters/Entity/BasicEntityPersister.php 1 patch
Spacing   +74 added lines, -74 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\Persisters\Entity;
6 6
 
@@ -300,14 +300,14 @@  discard block
 block discarded – undo
300 300
         $tableName      = $versionedClass->table->getQuotedQualifiedName($this->platform);
301 301
         $columnName     = $this->platform->quoteIdentifier($versionProperty->getColumnName());
302 302
         $identifier     = array_map(
303
-            function ($columnName) { return $this->platform->quoteIdentifier($columnName); },
303
+            function($columnName) { return $this->platform->quoteIdentifier($columnName); },
304 304
             array_keys($versionedClass->getIdentifierColumns($this->em))
305 305
         );
306 306
 
307 307
         // FIXME: Order with composite keys might not be correct
308
-        $sql = 'SELECT ' . $columnName
309
-             . ' FROM '  . $tableName
310
-             . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?';
308
+        $sql = 'SELECT '.$columnName
309
+             . ' FROM '.$tableName
310
+             . ' WHERE '.implode(' = ? AND ', $identifier).' = ?';
311 311
 
312 312
         $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id);
313 313
         $versionType = $versionProperty->getType();
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 
394 394
             if (($value = $identifier[$field]) !== null) {
395 395
                 // @todo guilhermeblanco Make sure we do not have flat association values.
396
-                if (! is_array($value)) {
396
+                if ( ! is_array($value)) {
397 397
                     $value = [$targetClass->identifier[0] => $value];
398 398
                 }
399 399
 
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
407 407
                 $targetField          = $targetClass->fieldNames[$referencedColumnName];
408 408
 
409
-                if (! $joinColumn->getType()) {
409
+                if ( ! $joinColumn->getType()) {
410 410
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
411 411
                 }
412 412
 
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
                         $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
475 475
                         $referencedColumnName = $joinColumn->getReferencedColumnName();
476 476
 
477
-                        if (! $joinColumn->getType()) {
477
+                        if ( ! $joinColumn->getType()) {
478 478
                             $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
479 479
                         }
480 480
 
@@ -501,18 +501,18 @@  discard block
 block discarded – undo
501 501
                 case Type::SMALLINT:
502 502
                 case Type::INTEGER:
503 503
                 case Type::BIGINT:
504
-                    $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1';
504
+                    $set[] = $versionColumnName.' = '.$versionColumnName.' + 1';
505 505
                     break;
506 506
 
507 507
                 case Type::DATETIME:
508
-                    $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP';
508
+                    $set[] = $versionColumnName.' = CURRENT_TIMESTAMP';
509 509
                     break;
510 510
             }
511 511
         }
512 512
 
513
-        $sql = 'UPDATE ' . $quotedTableName
514
-             . ' SET ' . implode(', ', $set)
515
-             . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?';
513
+        $sql = 'UPDATE '.$quotedTableName
514
+             . ' SET '.implode(', ', $set)
515
+             . ' WHERE '.implode(' = ? AND ', $where).' = ?';
516 516
 
517 517
         $result = $this->conn->executeUpdate($sql, $params, $types);
518 518
 
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
     protected function deleteJoinTableRecords($identifier)
532 532
     {
533 533
         foreach ($this->class->getDeclaredPropertiesIterator() as $association) {
534
-            if (! ($association instanceof ManyToManyAssociationMetadata)) {
534
+            if ( ! ($association instanceof ManyToManyAssociationMetadata)) {
535 535
                 continue;
536 536
             }
537 537
 
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
             $keys              = [];
545 545
 
546 546
             if ( ! $owningAssociation->isOwningSide()) {
547
-                $class       = $this->em->getClassMetadata($association->getTargetEntity());
547
+                $class = $this->em->getClassMetadata($association->getTargetEntity());
548 548
                 $owningAssociation = $class->getProperty($association->getMappedBy());
549 549
             }
550 550
 
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
             }
657 657
 
658 658
             // Only owning side of x-1 associations can have a FK column.
659
-            if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) {
659
+            if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) {
660 660
                 continue;
661 661
             }
662 662
 
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
                 /** @var JoinColumnMetadata $joinColumn */
677 677
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
678 678
 
679
-                if (! $joinColumn->getType()) {
679
+                if ( ! $joinColumn->getType()) {
680 680
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
681 681
                 }
682 682
 
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
         $propertyName = $this->class->fieldNames[$columnName];
706 706
         $property     = $this->class->getProperty($propertyName);
707 707
 
708
-        if (! $property) {
708
+        if ( ! $property) {
709 709
             return null;
710 710
         }
711 711
 
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
             /** @var JoinColumnMetadata $joinColumn */
725 725
             $referencedColumnName = $joinColumn->getReferencedColumnName();
726 726
 
727
-            if (! $joinColumn->getType()) {
727
+            if ( ! $joinColumn->getType()) {
728 728
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
729 729
             }
730 730
 
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
         $criteria       = [];
1062 1062
         $parameters     = [];
1063 1063
 
1064
-        if (! $association->isOwningSide()) {
1064
+        if ( ! $association->isOwningSide()) {
1065 1065
             $class       = $this->em->getClassMetadata($association->getTargetEntity());
1066 1066
             $owningAssoc = $class->getProperty($association->getMappedBy());
1067 1067
         }
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
                 $value = $value[$targetClass->identifier[0]];
1090 1090
             }
1091 1091
 
1092
-            $criteria[$joinTableName . '.' . $quotedColumnName] = $value;
1092
+            $criteria[$joinTableName.'.'.$quotedColumnName] = $value;
1093 1093
             $parameters[] = [
1094 1094
                 'value' => $value,
1095 1095
                 'field' => $fieldName,
@@ -1140,11 +1140,11 @@  discard block
 block discarded – undo
1140 1140
 
1141 1141
         switch ($lockMode) {
1142 1142
             case LockMode::PESSIMISTIC_READ:
1143
-                $lockSql = ' ' . $this->platform->getReadLockSQL();
1143
+                $lockSql = ' '.$this->platform->getReadLockSQL();
1144 1144
                 break;
1145 1145
 
1146 1146
             case LockMode::PESSIMISTIC_WRITE:
1147
-                $lockSql = ' ' . $this->platform->getWriteLockSQL();
1147
+                $lockSql = ' '.$this->platform->getWriteLockSQL();
1148 1148
                 break;
1149 1149
         }
1150 1150
 
@@ -1155,14 +1155,14 @@  discard block
 block discarded – undo
1155 1155
 
1156 1156
         if ('' !== $filterSql) {
1157 1157
             $conditionSql = $conditionSql
1158
-                ? $conditionSql . ' AND ' . $filterSql
1158
+                ? $conditionSql.' AND '.$filterSql
1159 1159
                 : $filterSql;
1160 1160
         }
1161 1161
 
1162
-        $select = 'SELECT ' . $columnList;
1163
-        $from   = ' FROM ' . $tableName . ' '. $tableAlias;
1164
-        $join   = $this->currentPersisterContext->selectJoinSql . $joinSql;
1165
-        $where  = ($conditionSql ? ' WHERE ' . $conditionSql : '');
1162
+        $select = 'SELECT '.$columnList;
1163
+        $from   = ' FROM '.$tableName.' '.$tableAlias;
1164
+        $join   = $this->currentPersisterContext->selectJoinSql.$joinSql;
1165
+        $where  = ($conditionSql ? ' WHERE '.$conditionSql : '');
1166 1166
         $lock   = $this->platform->appendLockHint($from, $lockMode);
1167 1167
         $query  = $select
1168 1168
             . $lock
@@ -1170,7 +1170,7 @@  discard block
 block discarded – undo
1170 1170
             . $where
1171 1171
             . $orderBySql;
1172 1172
 
1173
-        return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql;
1173
+        return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql;
1174 1174
     }
1175 1175
 
1176 1176
     /**
@@ -1189,13 +1189,13 @@  discard block
 block discarded – undo
1189 1189
 
1190 1190
         if ('' !== $filterSql) {
1191 1191
             $conditionSql = $conditionSql
1192
-                ? $conditionSql . ' AND ' . $filterSql
1192
+                ? $conditionSql.' AND '.$filterSql
1193 1193
                 : $filterSql;
1194 1194
         }
1195 1195
 
1196 1196
         $sql = 'SELECT COUNT(*) '
1197
-            . 'FROM ' . $tableName . ' ' . $tableAlias
1198
-            . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql);
1197
+            . 'FROM '.$tableName.' '.$tableAlias
1198
+            . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql);
1199 1199
 
1200 1200
         return $sql;
1201 1201
     }
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
      */
1213 1213
     protected final function getOrderBySQL(array $orderBy, $baseTableAlias)
1214 1214
     {
1215
-        if (! $orderBy) {
1215
+        if ( ! $orderBy) {
1216 1216
             return '';
1217 1217
         }
1218 1218
 
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
         foreach ($orderBy as $fieldName => $orientation) {
1222 1222
             $orientation = strtoupper(trim($orientation));
1223 1223
 
1224
-            if (! in_array($orientation, ['ASC', 'DESC'])) {
1224
+            if ( ! in_array($orientation, ['ASC', 'DESC'])) {
1225 1225
                 throw ORMException::invalidOrientation($this->class->getClassName(), $fieldName);
1226 1226
             }
1227 1227
 
@@ -1231,11 +1231,11 @@  discard block
 block discarded – undo
1231 1231
                 $tableAlias = $this->getSQLTableAlias($property->getTableName());
1232 1232
                 $columnName = $this->platform->quoteIdentifier($property->getColumnName());
1233 1233
 
1234
-                $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation;
1234
+                $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation;
1235 1235
 
1236 1236
                 continue;
1237 1237
             } else if ($property instanceof AssociationMetadata) {
1238
-                if (! $property->isOwningSide()) {
1238
+                if ( ! $property->isOwningSide()) {
1239 1239
                     throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $fieldName);
1240 1240
                 }
1241 1241
 
@@ -1248,7 +1248,7 @@  discard block
 block discarded – undo
1248 1248
                     /* @var JoinColumnMetadata $joinColumn */
1249 1249
                     $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName());
1250 1250
 
1251
-                    $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation;
1251
+                    $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation;
1252 1252
                 }
1253 1253
 
1254 1254
                 continue;
@@ -1257,7 +1257,7 @@  discard block
 block discarded – undo
1257 1257
             throw ORMException::unrecognizedField($fieldName);
1258 1258
         }
1259 1259
 
1260
-        return ' ORDER BY ' . implode(', ', $orderByList);
1260
+        return ' ORDER BY '.implode(', ', $orderByList);
1261 1261
     }
1262 1262
 
1263 1263
     /**
@@ -1279,7 +1279,7 @@  discard block
 block discarded – undo
1279 1279
 
1280 1280
 
1281 1281
         $this->currentPersisterContext->rsm->addEntityResult($this->class->getClassName(), 'r'); // r for root
1282
-        $this->currentPersisterContext->selectJoinSql    = '';
1282
+        $this->currentPersisterContext->selectJoinSql = '';
1283 1283
 
1284 1284
         $eagerAliasCounter = 0;
1285 1285
         $columnList        = [];
@@ -1315,7 +1315,7 @@  discard block
 block discarded – undo
1315 1315
                         break; // now this is why you shouldn't use inheritance
1316 1316
                     }
1317 1317
 
1318
-                    $assocAlias = 'e' . ($eagerAliasCounter++);
1318
+                    $assocAlias = 'e'.($eagerAliasCounter++);
1319 1319
 
1320 1320
                     $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName);
1321 1321
 
@@ -1340,14 +1340,14 @@  discard block
 block discarded – undo
1340 1340
                         $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy());
1341 1341
                     }
1342 1342
 
1343
-                    if (! $property->isOwningSide()) {
1343
+                    if ( ! $property->isOwningSide()) {
1344 1344
                         $owningAssociation = $eagerEntity->getProperty($property->getMappedBy());
1345 1345
                     }
1346 1346
 
1347 1347
                     $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias);
1348 1348
                     $joinTableName  = $eagerEntity->table->getQuotedQualifiedName($this->platform);
1349 1349
 
1350
-                    $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property);
1350
+                    $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property);
1351 1351
 
1352 1352
                     $sourceClass      = $this->em->getClassMetadata($owningAssociation->getSourceEntity());
1353 1353
                     $targetClass      = $this->em->getClassMetadata($owningAssociation->getTargetEntity());
@@ -1369,7 +1369,7 @@  discard block
 block discarded – undo
1369 1369
                         $joinCondition[] = $filterSql;
1370 1370
                     }
1371 1371
 
1372
-                    $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON ';
1372
+                    $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON ';
1373 1373
                     $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition);
1374 1374
 
1375 1375
                     break;
@@ -1393,7 +1393,7 @@  discard block
 block discarded – undo
1393 1393
      */
1394 1394
     protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r')
1395 1395
     {
1396
-        if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) {
1396
+        if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) {
1397 1397
             return '';
1398 1398
         }
1399 1399
 
@@ -1408,7 +1408,7 @@  discard block
 block discarded – undo
1408 1408
             $referencedColumnName = $joinColumn->getReferencedColumnName();
1409 1409
             $resultColumnName     = $this->getSQLColumnAlias();
1410 1410
 
1411
-            if (! $joinColumn->getType()) {
1411
+            if ( ! $joinColumn->getType()) {
1412 1412
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
1413 1413
             }
1414 1414
 
@@ -1440,7 +1440,7 @@  discard block
 block discarded – undo
1440 1440
         $owningAssociation = $association;
1441 1441
         $sourceTableAlias  = $this->getSQLTableAlias($this->class->getTableName());
1442 1442
 
1443
-        if (! $association->isOwningSide()) {
1443
+        if ( ! $association->isOwningSide()) {
1444 1444
             $targetEntity      = $this->em->getClassMetadata($association->getTargetEntity());
1445 1445
             $owningAssociation = $targetEntity->getProperty($association->getMappedBy());
1446 1446
         }
@@ -1462,7 +1462,7 @@  discard block
 block discarded – undo
1462 1462
             );
1463 1463
         }
1464 1464
 
1465
-        return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions);
1465
+        return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions);
1466 1466
     }
1467 1467
 
1468 1468
     /**
@@ -1557,7 +1557,7 @@  discard block
 block discarded – undo
1557 1557
                             $columnName           = $joinColumn->getColumnName();
1558 1558
                             $referencedColumnName = $joinColumn->getReferencedColumnName();
1559 1559
 
1560
-                            if (! $joinColumn->getType()) {
1560
+                            if ( ! $joinColumn->getType()) {
1561 1561
                                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
1562 1562
                             }
1563 1563
 
@@ -1596,7 +1596,7 @@  discard block
 block discarded – undo
1596 1596
 
1597 1597
         $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName());
1598 1598
 
1599
-        return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias;
1599
+        return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias;
1600 1600
     }
1601 1601
 
1602 1602
     /**
@@ -1610,14 +1610,14 @@  discard block
 block discarded – undo
1610 1610
     protected function getSQLTableAlias($tableName, $assocName = '')
1611 1611
     {
1612 1612
         if ($tableName) {
1613
-            $tableName .= '#' . $assocName;
1613
+            $tableName .= '#'.$assocName;
1614 1614
         }
1615 1615
 
1616 1616
         if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) {
1617 1617
             return $this->currentPersisterContext->sqlTableAliases[$tableName];
1618 1618
         }
1619 1619
 
1620
-        $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++;
1620
+        $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++;
1621 1621
 
1622 1622
         $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias;
1623 1623
 
@@ -1644,7 +1644,7 @@  discard block
 block discarded – undo
1644 1644
         }
1645 1645
 
1646 1646
         $lock  = $this->getLockTablesSql($lockMode);
1647
-        $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' ';
1647
+        $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' ';
1648 1648
         $sql = 'SELECT 1 '
1649 1649
              . $lock
1650 1650
              . $where
@@ -1667,7 +1667,7 @@  discard block
 block discarded – undo
1667 1667
         $tableName = $this->class->table->getQuotedQualifiedName($this->platform);
1668 1668
 
1669 1669
         return $this->platform->appendLockHint(
1670
-            'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()),
1670
+            'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()),
1671 1671
             $lockMode
1672 1672
         );
1673 1673
     }
@@ -1720,19 +1720,19 @@  discard block
 block discarded – undo
1720 1720
 
1721 1721
             if (null !== $comparison) {
1722 1722
                 // special case null value handling
1723
-                if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) {
1724
-                    $selectedColumns[] = $column . ' IS NULL';
1723
+                if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) {
1724
+                    $selectedColumns[] = $column.' IS NULL';
1725 1725
 
1726 1726
                     continue;
1727 1727
                 }
1728 1728
 
1729 1729
                 if ($comparison === Comparison::NEQ && null === $value) {
1730
-                    $selectedColumns[] = $column . ' IS NOT NULL';
1730
+                    $selectedColumns[] = $column.' IS NOT NULL';
1731 1731
 
1732 1732
                     continue;
1733 1733
                 }
1734 1734
 
1735
-                $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder);
1735
+                $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder);
1736 1736
 
1737 1737
                 continue;
1738 1738
             }
@@ -1778,7 +1778,7 @@  discard block
 block discarded – undo
1778 1778
         if (isset($this->class->fieldMappings[$field])) {
1779 1779
             $className = $this->class->fieldMappings[$field]['inherited'] ?? $this->class->name;
1780 1780
 
1781
-            return [$tableAlias . '.' . $columnName];
1781
+            return [$tableAlias.'.'.$columnName];
1782 1782
         }
1783 1783
 
1784 1784
         if ($property instanceof AssociationMetadata) {
@@ -1787,7 +1787,7 @@  discard block
 block discarded – undo
1787 1787
 
1788 1788
             // Many-To-Many requires join table check for joinColumn
1789 1789
             if ($owningAssociation instanceof ManyToManyAssociationMetadata) {
1790
-                if (! $owningAssociation->isOwningSide()) {
1790
+                if ( ! $owningAssociation->isOwningSide()) {
1791 1791
                     $owningAssociation = $association;
1792 1792
                 }
1793 1793
 
@@ -1801,17 +1801,17 @@  discard block
 block discarded – undo
1801 1801
                 foreach ($joinColumns as $joinColumn) {
1802 1802
                     $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName());
1803 1803
 
1804
-                    $columns[] = $joinTableName . '.' . $quotedColumnName;
1804
+                    $columns[] = $joinTableName.'.'.$quotedColumnName;
1805 1805
                 }
1806 1806
 
1807 1807
             } else {
1808
-                if (! $owningAssociation->isOwningSide()) {
1808
+                if ( ! $owningAssociation->isOwningSide()) {
1809 1809
                     throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $field);
1810 1810
                 }
1811 1811
 
1812 1812
                 $className = $association['inherited'] ?? $this->class->name;
1813 1813
 
1814
-                    $columns[] = $tableAlias . '.' . $quotedColumnName;
1814
+                    $columns[] = $tableAlias.'.'.$quotedColumnName;
1815 1815
                 }
1816 1816
             }
1817 1817
 
@@ -1924,7 +1924,7 @@  discard block
 block discarded – undo
1924 1924
                 $value = $value[$targetClass->identifier[0]];
1925 1925
             }
1926 1926
 
1927
-            $criteria[$tableAlias . "." . $quotedColumnName] = $value;
1927
+            $criteria[$tableAlias.".".$quotedColumnName] = $value;
1928 1928
             $parameters[] = [
1929 1929
                 'value' => $value,
1930 1930
                 'field' => $fieldName,
@@ -2011,7 +2011,7 @@  discard block
 block discarded – undo
2011 2011
             case ($property instanceof AssociationMetadata):
2012 2012
                 $class = $this->em->getClassMetadata($property->getTargetEntity());
2013 2013
 
2014
-                if (! $property->isOwningSide()) {
2014
+                if ( ! $property->isOwningSide()) {
2015 2015
                     $property = $class->getProperty($property->getMappedBy());
2016 2016
                     $class    = $this->em->getClassMetadata($property->getTargetEntity());
2017 2017
                 }
@@ -2025,7 +2025,7 @@  discard block
 block discarded – undo
2025 2025
                     /** @var JoinColumnMetadata $joinColumn */
2026 2026
                     $referencedColumnName = $joinColumn->getReferencedColumnName();
2027 2027
 
2028
-                    if (! $joinColumn->getType()) {
2028
+                    if ( ! $joinColumn->getType()) {
2029 2029
                         $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em));
2030 2030
                     }
2031 2031
 
@@ -2040,7 +2040,7 @@  discard block
 block discarded – undo
2040 2040
         }
2041 2041
 
2042 2042
         if (is_array($value)) {
2043
-            return array_map(function ($type) {
2043
+            return array_map(function($type) {
2044 2044
                 return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET;
2045 2045
             }, $types);
2046 2046
         }
@@ -2119,12 +2119,12 @@  discard block
 block discarded – undo
2119 2119
 
2120 2120
         $sql = 'SELECT 1 '
2121 2121
              . $this->getLockTablesSql(null)
2122
-             . ' WHERE ' . $this->getSelectConditionSQL($criteria);
2122
+             . ' WHERE '.$this->getSelectConditionSQL($criteria);
2123 2123
 
2124 2124
         list($params, $types) = $this->expandParameters($criteria);
2125 2125
 
2126 2126
         if (null !== $extraConditions) {
2127
-            $sql                                 .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions);
2127
+            $sql                                 .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions);
2128 2128
             list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions);
2129 2129
 
2130 2130
             $params = array_merge($params, $criteriaParams);
@@ -2132,7 +2132,7 @@  discard block
 block discarded – undo
2132 2132
         }
2133 2133
 
2134 2134
         if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) {
2135
-            $sql .= ' AND ' . $filterSql;
2135
+            $sql .= ' AND '.$filterSql;
2136 2136
         }
2137 2137
 
2138 2138
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
@@ -2147,13 +2147,13 @@  discard block
 block discarded – undo
2147 2147
      */
2148 2148
     protected function getJoinSQLForAssociation(AssociationMetadata $association)
2149 2149
     {
2150
-        if (! $association->isOwningSide()) {
2150
+        if ( ! $association->isOwningSide()) {
2151 2151
             return 'LEFT JOIN';
2152 2152
         }
2153 2153
 
2154 2154
         // if one of the join columns is nullable, return left join
2155 2155
         foreach ($association->getJoinColumns() as $joinColumn) {
2156
-             if (! $joinColumn->isNullable()) {
2156
+             if ( ! $joinColumn->isNullable()) {
2157 2157
                  continue;
2158 2158
              }
2159 2159
 
@@ -2170,7 +2170,7 @@  discard block
 block discarded – undo
2170 2170
      */
2171 2171
     public function getSQLColumnAlias()
2172 2172
     {
2173
-        return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++);
2173
+        return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++);
2174 2174
     }
2175 2175
 
2176 2176
     /**
@@ -2187,13 +2187,13 @@  discard block
 block discarded – undo
2187 2187
 
2188 2188
         foreach ($this->em->getFilters()->getEnabledFilters() as $filter) {
2189 2189
             if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) {
2190
-                $filterClauses[] = '(' . $filterExpr . ')';
2190
+                $filterClauses[] = '('.$filterExpr.')';
2191 2191
             }
2192 2192
         }
2193 2193
 
2194 2194
         $sql = implode(' AND ', $filterClauses);
2195 2195
 
2196
-        return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL"
2196
+        return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL"
2197 2197
     }
2198 2198
 
2199 2199
     /**
Please login to merge, or discard this patch.