Passed
Pull Request — master (#6683)
by
unknown
13:47
created
lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php 1 patch
Spacing   +36 added lines, -36 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
 
@@ -1627,7 +1627,7 @@  discard block
 block discarded – undo
1627 1627
                     throw new RuntimeException("ClassMetadataInfo::setTable() has to be called before defining a one to one relationship.");
1628 1628
                 }
1629 1629
 
1630
-                $this->table['uniqueConstraints'][$mapping['fieldName'] . "_uniq"] = [
1630
+                $this->table['uniqueConstraints'][$mapping['fieldName']."_uniq"] = [
1631 1631
                     'columns' => $uniqueConstraintColumns
1632 1632
                 ];
1633 1633
             }
@@ -1642,7 +1642,7 @@  discard block
 block discarded – undo
1642 1642
             unset($mapping['unique']);
1643 1643
         }
1644 1644
 
1645
-        if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) {
1645
+        if (isset($mapping['id']) && $mapping['id'] === true && ! $mapping['isOwningSide']) {
1646 1646
             throw MappingException::illegalInverseIdentifierAssociation($this->name, $mapping['fieldName']);
1647 1647
         }
1648 1648
 
@@ -1696,7 +1696,7 @@  discard block
 block discarded – undo
1696 1696
             }
1697 1697
 
1698 1698
             $selfReferencingEntityWithoutJoinColumns = $mapping['sourceEntity'] == $mapping['targetEntity']
1699
-                && (! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns'])));
1699
+                && ( ! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns'])));
1700 1700
 
1701 1701
             if ( ! isset($mapping['joinTable']['joinColumns'])) {
1702 1702
                 $mapping['joinTable']['joinColumns'] = [
@@ -1889,7 +1889,7 @@  discard block
 block discarded – undo
1889 1889
 
1890 1890
             // Association defined as Id field
1891 1891
             $joinColumns      = $this->associationMappings[$idProperty]['joinColumns'];
1892
-            $assocColumnNames = array_map(function ($joinColumn) { return $joinColumn['name']; }, $joinColumns);
1892
+            $assocColumnNames = array_map(function($joinColumn) { return $joinColumn['name']; }, $joinColumns);
1893 1893
 
1894 1894
             $columnNames = array_merge($columnNames, $assocColumnNames);
1895 1895
         }
@@ -2070,7 +2070,7 @@  discard block
 block discarded – undo
2070 2070
     public function getTemporaryIdTableName()
2071 2071
     {
2072 2072
         // replace dots with underscores because PostgreSQL creates temporary tables in a special schema
2073
-        return str_replace('.', '_', $this->getTableName() . '_id_tmp');
2073
+        return str_replace('.', '_', $this->getTableName().'_id_tmp');
2074 2074
     }
2075 2075
 
2076 2076
     /**
@@ -2407,7 +2407,7 @@  discard block
 block discarded – undo
2407 2407
      */
2408 2408
     public function addNamedQuery(array $queryMapping)
2409 2409
     {
2410
-        if (!isset($queryMapping['name'])) {
2410
+        if ( ! isset($queryMapping['name'])) {
2411 2411
             throw MappingException::nameIsMandatoryForQueryMapping($this->name);
2412 2412
         }
2413 2413
 
@@ -2415,7 +2415,7 @@  discard block
 block discarded – undo
2415 2415
             throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']);
2416 2416
         }
2417 2417
 
2418
-        if (!isset($queryMapping['query'])) {
2418
+        if ( ! isset($queryMapping['query'])) {
2419 2419
             throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']);
2420 2420
         }
2421 2421
 
@@ -2442,7 +2442,7 @@  discard block
 block discarded – undo
2442 2442
      */
2443 2443
     public function addNamedNativeQuery(array $queryMapping)
2444 2444
     {
2445
-        if (!isset($queryMapping['name'])) {
2445
+        if ( ! isset($queryMapping['name'])) {
2446 2446
             throw MappingException::nameIsMandatoryForQueryMapping($this->name);
2447 2447
         }
2448 2448
 
@@ -2450,11 +2450,11 @@  discard block
 block discarded – undo
2450 2450
             throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']);
2451 2451
         }
2452 2452
 
2453
-        if (!isset($queryMapping['query'])) {
2453
+        if ( ! isset($queryMapping['query'])) {
2454 2454
             throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']);
2455 2455
         }
2456 2456
 
2457
-        if (!isset($queryMapping['resultClass']) && !isset($queryMapping['resultSetMapping'])) {
2457
+        if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) {
2458 2458
             throw MappingException::missingQueryMapping($this->name, $queryMapping['name']);
2459 2459
         }
2460 2460
 
@@ -2486,7 +2486,7 @@  discard block
 block discarded – undo
2486 2486
      */
2487 2487
     public function addSqlResultSetMapping(array $resultMapping)
2488 2488
     {
2489
-        if (!isset($resultMapping['name'])) {
2489
+        if ( ! isset($resultMapping['name'])) {
2490 2490
             throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name);
2491 2491
         }
2492 2492
 
@@ -2496,7 +2496,7 @@  discard block
 block discarded – undo
2496 2496
 
2497 2497
         if (isset($resultMapping['entities'])) {
2498 2498
             foreach ($resultMapping['entities'] as $key => $entityResult) {
2499
-                if (!isset($entityResult['entityClass'])) {
2499
+                if ( ! isset($entityResult['entityClass'])) {
2500 2500
                     throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']);
2501 2501
                 }
2502 2502
 
@@ -2515,11 +2515,11 @@  discard block
 block discarded – undo
2515 2515
 
2516 2516
                 if (isset($entityResult['fields'])) {
2517 2517
                     foreach ($entityResult['fields'] as $k => $field) {
2518
-                        if (!isset($field['name'])) {
2518
+                        if ( ! isset($field['name'])) {
2519 2519
                             throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']);
2520 2520
                         }
2521 2521
 
2522
-                        if (!isset($field['column'])) {
2522
+                        if ( ! isset($field['column'])) {
2523 2523
                             $fieldName = $field['name'];
2524 2524
                             if (strpos($fieldName, '.')) {
2525 2525
                                 list(, $fieldName) = explode('.', $fieldName);
@@ -3010,15 +3010,15 @@  discard block
 block discarded – undo
3010 3010
         }
3011 3011
 
3012 3012
         if ($definition['sequenceName'][0] == '`') {
3013
-            $definition['sequenceName']   = trim($definition['sequenceName'], '`');
3013
+            $definition['sequenceName'] = trim($definition['sequenceName'], '`');
3014 3014
             $definition['quoted'] = true;
3015 3015
         }
3016 3016
 
3017
-        if(! isset($definition['allocationSize']) || trim($definition['allocationSize']) === '') {
3017
+        if ( ! isset($definition['allocationSize']) || trim($definition['allocationSize']) === '') {
3018 3018
             $definition['allocationSize'] = '1';
3019 3019
         }
3020 3020
 
3021
-        if(! isset($definition['initialValue']) || trim($definition['initialValue']) === '') {
3021
+        if ( ! isset($definition['initialValue']) || trim($definition['initialValue']) === '') {
3022 3022
             $definition['initialValue'] = '1';
3023 3023
         }
3024 3024
 
@@ -3110,7 +3110,7 @@  discard block
 block discarded – undo
3110 3110
     public function getAssociationTargetClass($assocName)
3111 3111
     {
3112 3112
         if ( ! isset($this->associationMappings[$assocName])) {
3113
-            throw new InvalidArgumentException("Association name expected, '" . $assocName ."' is not an association.");
3113
+            throw new InvalidArgumentException("Association name expected, '".$assocName."' is not an association.");
3114 3114
         }
3115 3115
 
3116 3116
         return $this->associationMappings[$assocName]['targetEntity'];
@@ -3149,7 +3149,7 @@  discard block
 block discarded – undo
3149 3149
             // Association defined as Id field
3150 3150
             $joinColumns            = $this->associationMappings[$idProperty]['joinColumns'];
3151 3151
             $assocQuotedColumnNames = array_map(
3152
-                function ($joinColumn) use ($platform) {
3152
+                function($joinColumn) use ($platform) {
3153 3153
                     return isset($joinColumn['quoted'])
3154 3154
                         ? $platform->quoteIdentifier($joinColumn['name'])
3155 3155
                         : $joinColumn['name'];
@@ -3260,7 +3260,7 @@  discard block
 block discarded – undo
3260 3260
         }
3261 3261
 
3262 3262
         if ($className !== null && strpos($className, '\\') === false && $this->namespace) {
3263
-            return $this->namespace . '\\' . $className;
3263
+            return $this->namespace.'\\'.$className;
3264 3264
         }
3265 3265
 
3266 3266
         return $className;
@@ -3314,15 +3314,15 @@  discard block
 block discarded – undo
3314 3314
                 ? $fieldMapping['originalClass']
3315 3315
                 : $embeddable->name;
3316 3316
             $fieldMapping['declaredField'] = isset($fieldMapping['declaredField'])
3317
-                ? $property . '.' . $fieldMapping['declaredField']
3317
+                ? $property.'.'.$fieldMapping['declaredField']
3318 3318
                 : $property;
3319 3319
             $fieldMapping['originalField'] = isset($fieldMapping['originalField'])
3320 3320
                 ? $fieldMapping['originalField']
3321 3321
                 : $fieldMapping['fieldName'];
3322
-            $fieldMapping['fieldName'] = $property . "." . $fieldMapping['fieldName'];
3322
+            $fieldMapping['fieldName'] = $property.".".$fieldMapping['fieldName'];
3323 3323
 
3324
-            if (! empty($this->embeddedClasses[$property]['columnPrefix'])) {
3325
-                $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName'];
3324
+            if ( ! empty($this->embeddedClasses[$property]['columnPrefix'])) {
3325
+                $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'].$fieldMapping['columnName'];
3326 3326
             } elseif ($this->embeddedClasses[$property]['columnPrefix'] !== false) {
3327 3327
                 $fieldMapping['columnName'] = $this->namingStrategy
3328 3328
                     ->embeddedFieldToColumnName(
@@ -3363,7 +3363,7 @@  discard block
 block discarded – undo
3363 3363
     {
3364 3364
         $sequencePrefix = $this->getSequencePrefix($platform);
3365 3365
         $columnName     = $this->getSingleIdentifierColumnName();
3366
-        $sequenceName   = $sequencePrefix . '_' . $columnName . '_seq';
3366
+        $sequenceName   = $sequencePrefix.'_'.$columnName.'_seq';
3367 3367
 
3368 3368
         return $sequenceName;
3369 3369
     }
@@ -3383,10 +3383,10 @@  discard block
 block discarded – undo
3383 3383
 
3384 3384
         // Prepend the schema name to the table name if there is one
3385 3385
         if ($schemaName = $this->getSchemaName()) {
3386
-            $sequencePrefix = $schemaName . '.' . $tableName;
3386
+            $sequencePrefix = $schemaName.'.'.$tableName;
3387 3387
 
3388 3388
             if ( ! $platform->supportsSchemas() && $platform->canEmulateSchemas()) {
3389
-                $sequencePrefix = $schemaName . '__' . $tableName;
3389
+                $sequencePrefix = $schemaName.'__'.$tableName;
3390 3390
             }
3391 3391
         }
3392 3392
 
@@ -3398,8 +3398,8 @@  discard block
 block discarded – undo
3398 3398
      */
3399 3399
     private function assertMappingOrderBy(array $mapping)
3400 3400
     {
3401
-        if (isset($mapping['orderBy']) && !is_array($mapping['orderBy'])) {
3402
-            throw new InvalidArgumentException("'orderBy' is expected to be an array, not " . gettype($mapping['orderBy']));
3401
+        if (isset($mapping['orderBy']) && ! is_array($mapping['orderBy'])) {
3402
+            throw new InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy']));
3403 3403
         }
3404 3404
     }
3405 3405
 }
Please login to merge, or discard this patch.