Passed
Pull Request — 2.7 (#6886)
by Grégoire
10:40
created
lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     ClassMetadata::class
26 26
 ), E_USER_DEPRECATED);
27 27
 
28
-if (!class_exists(ClassMetadataInfo::class, false)) {
28
+if ( ! class_exists(ClassMetadataInfo::class, false)) {
29 29
     class_exists(ClassMetadata::class);
30 30
 }
31 31
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/ClassMetadata.php 1 patch
Spacing   +35 added lines, -35 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("ClassMetadata::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
 
@@ -3108,7 +3108,7 @@  discard block
 block discarded – undo
3108 3108
     public function getAssociationTargetClass($assocName)
3109 3109
     {
3110 3110
         if ( ! isset($this->associationMappings[$assocName])) {
3111
-            throw new InvalidArgumentException("Association name expected, '" . $assocName ."' is not an association.");
3111
+            throw new InvalidArgumentException("Association name expected, '".$assocName."' is not an association.");
3112 3112
         }
3113 3113
 
3114 3114
         return $this->associationMappings[$assocName]['targetEntity'];
@@ -3147,7 +3147,7 @@  discard block
 block discarded – undo
3147 3147
             // Association defined as Id field
3148 3148
             $joinColumns            = $this->associationMappings[$idProperty]['joinColumns'];
3149 3149
             $assocQuotedColumnNames = array_map(
3150
-                function ($joinColumn) use ($platform) {
3150
+                function($joinColumn) use ($platform) {
3151 3151
                     return isset($joinColumn['quoted'])
3152 3152
                         ? $platform->quoteIdentifier($joinColumn['name'])
3153 3153
                         : $joinColumn['name'];
@@ -3258,7 +3258,7 @@  discard block
 block discarded – undo
3258 3258
         }
3259 3259
 
3260 3260
         if ($className !== null && strpos($className, '\\') === false && $this->namespace) {
3261
-            return $this->namespace . '\\' . $className;
3261
+            return $this->namespace.'\\'.$className;
3262 3262
         }
3263 3263
 
3264 3264
         return $className;
@@ -3310,13 +3310,13 @@  discard block
 block discarded – undo
3310 3310
         foreach ($embeddable->fieldMappings as $fieldMapping) {
3311 3311
             $fieldMapping['originalClass'] = $fieldMapping['originalClass'] ?? $embeddable->name;
3312 3312
             $fieldMapping['declaredField'] = isset($fieldMapping['declaredField'])
3313
-                ? $property . '.' . $fieldMapping['declaredField']
3313
+                ? $property.'.'.$fieldMapping['declaredField']
3314 3314
                 : $property;
3315 3315
             $fieldMapping['originalField'] = $fieldMapping['originalField'] ?? $fieldMapping['fieldName'];
3316
-            $fieldMapping['fieldName'] = $property . "." . $fieldMapping['fieldName'];
3316
+            $fieldMapping['fieldName'] = $property.".".$fieldMapping['fieldName'];
3317 3317
 
3318
-            if (! empty($this->embeddedClasses[$property]['columnPrefix'])) {
3319
-                $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName'];
3318
+            if ( ! empty($this->embeddedClasses[$property]['columnPrefix'])) {
3319
+                $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'].$fieldMapping['columnName'];
3320 3320
             } elseif ($this->embeddedClasses[$property]['columnPrefix'] !== false) {
3321 3321
                 $fieldMapping['columnName'] = $this->namingStrategy
3322 3322
                     ->embeddedFieldToColumnName(
@@ -3357,7 +3357,7 @@  discard block
 block discarded – undo
3357 3357
     {
3358 3358
         $sequencePrefix = $this->getSequencePrefix($platform);
3359 3359
         $columnName     = $this->getSingleIdentifierColumnName();
3360
-        $sequenceName   = $sequencePrefix . '_' . $columnName . '_seq';
3360
+        $sequenceName   = $sequencePrefix.'_'.$columnName.'_seq';
3361 3361
 
3362 3362
         return $sequenceName;
3363 3363
     }
@@ -3377,10 +3377,10 @@  discard block
 block discarded – undo
3377 3377
 
3378 3378
         // Prepend the schema name to the table name if there is one
3379 3379
         if ($schemaName = $this->getSchemaName()) {
3380
-            $sequencePrefix = $schemaName . '.' . $tableName;
3380
+            $sequencePrefix = $schemaName.'.'.$tableName;
3381 3381
 
3382 3382
             if ( ! $platform->supportsSchemas() && $platform->canEmulateSchemas()) {
3383
-                $sequencePrefix = $schemaName . '__' . $tableName;
3383
+                $sequencePrefix = $schemaName.'__'.$tableName;
3384 3384
             }
3385 3385
         }
3386 3386
 
@@ -3392,12 +3392,12 @@  discard block
 block discarded – undo
3392 3392
      */
3393 3393
     private function assertMappingOrderBy(array $mapping)
3394 3394
     {
3395
-        if (isset($mapping['orderBy']) && !is_array($mapping['orderBy'])) {
3396
-            throw new InvalidArgumentException("'orderBy' is expected to be an array, not " . gettype($mapping['orderBy']));
3395
+        if (isset($mapping['orderBy']) && ! is_array($mapping['orderBy'])) {
3396
+            throw new InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy']));
3397 3397
         }
3398 3398
     }
3399 3399
 }
3400 3400
 
3401
-if (!class_exists(ClassMetadataInfo::class, false)) {
3401
+if ( ! class_exists(ClassMetadataInfo::class, false)) {
3402 3402
     class_alias(ClassMetadata::class, ClassMetadataInfo::class);
3403 3403
 }
Please login to merge, or discard this patch.