Completed
Branch develop (d0d4c6)
by Marco
16:40
created
lib/Doctrine/ORM/Sequencing/TableGenerator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
                         $this->_tableName, $this->_sequenceName, $this->_allocationSize
93 93
                     );
94 94
 
95
-                    if ($conn->executeUpdate($updateSql, array(1 => $currentLevel, 2 => $currentLevel+1)) !== 1) {
95
+                    if ($conn->executeUpdate($updateSql, array(1 => $currentLevel, 2 => $currentLevel + 1)) !== 1) {
96 96
                         // no affected rows, concurrency issue, throw exception
97 97
                     }
98 98
                 } else {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/EntityGenerator.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
 
1298 1298
             $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata);
1299 1299
             $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName']
1300
-                     . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n";
1300
+                        . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n";
1301 1301
         }
1302 1302
 
1303 1303
         return implode("\n", $lines);
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
 
1328 1328
             $lines[] = $this->generateFieldMappingPropertyDocBlock($property, $metadata);
1329 1329
             $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldName
1330
-                     . (isset($options['default']) ? ' = ' . var_export($options['default'], true) : null) . ";\n";
1330
+                        . (isset($options['default']) ? ' = ' . var_export($options['default'], true) : null) . ";\n";
1331 1331
         }
1332 1332
 
1333 1333
         return implode("\n", $lines);
@@ -1391,14 +1391,14 @@  discard block
 block discarded – undo
1391 1391
         }
1392 1392
 
1393 1393
         $replacements = array(
1394
-          '<description>'       => ucfirst($type) . ' ' . $variableName,
1395
-          '<methodTypeHint>'    => $methodTypeHint,
1396
-          '<variableType>'      => $variableType,
1397
-          '<variableName>'      => $variableName,
1398
-          '<methodName>'        => $methodName,
1399
-          '<fieldName>'         => $fieldName,
1400
-          '<variableDefault>'   => ($defaultValue !== null ) ? (' = '.$defaultValue) : '',
1401
-          '<entity>'            => $this->getClassName($metadata)
1394
+            '<description>'       => ucfirst($type) . ' ' . $variableName,
1395
+            '<methodTypeHint>'    => $methodTypeHint,
1396
+            '<variableType>'      => $variableType,
1397
+            '<variableName>'      => $variableName,
1398
+            '<methodName>'        => $methodName,
1399
+            '<fieldName>'         => $fieldName,
1400
+            '<variableDefault>'   => ($defaultValue !== null ) ? (' = '.$defaultValue) : '',
1401
+            '<entity>'            => $this->getClassName($metadata)
1402 1402
         );
1403 1403
 
1404 1404
         $method = str_replace(
Please login to merge, or discard this patch.
Spacing   +133 added lines, -133 removed lines patch added patch discarded remove patch
@@ -365,14 +365,14 @@  discard block
 block discarded – undo
365 365
      */
366 366
     public function writeEntityClass(ClassMetadata $metadata, $outputDirectory)
367 367
     {
368
-        $path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name) . $this->extension;
368
+        $path = $outputDirectory.'/'.str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name).$this->extension;
369 369
         $dir = dirname($path);
370 370
 
371 371
         if ( ! is_dir($dir)) {
372 372
             mkdir($dir, 0775, true);
373 373
         }
374 374
 
375
-        $this->isNew = !file_exists($path) || (file_exists($path) && $this->regenerateEntityIfExists);
375
+        $this->isNew = ! file_exists($path) || (file_exists($path) && $this->regenerateEntityIfExists);
376 376
 
377 377
         if ( ! $this->isNew) {
378 378
             $this->parseTokensInEntityFile(file_get_contents($path));
@@ -381,8 +381,8 @@  discard block
 block discarded – undo
381 381
         }
382 382
 
383 383
         if ($this->backupExisting && file_exists($path)) {
384
-            $backupPath = dirname($path) . DIRECTORY_SEPARATOR . basename($path) . "~";
385
-            if (!copy($path, $backupPath)) {
384
+            $backupPath = dirname($path).DIRECTORY_SEPARATOR.basename($path)."~";
385
+            if ( ! copy($path, $backupPath)) {
386 386
                 throw new \RuntimeException("Attempt to backup overwritten entity file but copy operation failed.");
387 387
             }
388 388
         }
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
             $this->generateEntityBody($metadata)
423 423
         );
424 424
 
425
-        $code = str_replace($placeHolders, $replacements, static::$classTemplate) . "\n";
425
+        $code = str_replace($placeHolders, $replacements, static::$classTemplate)."\n";
426 426
 
427 427
         return str_replace('<spaces>', $this->spaces, $code);
428 428
     }
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
         $body = str_replace('<spaces>', $this->spaces, $body);
444 444
         $last = strrpos($currentCode, '}');
445 445
 
446
-        return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : '') . "}\n";
446
+        return substr($currentCode, 0, $last).$body.(strlen($body) > 0 ? "\n" : '')."}\n";
447 447
     }
448 448
 
449 449
     /**
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
     public function setFieldVisibility($visibility)
508 508
     {
509 509
         if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) {
510
-            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility);
510
+            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility);
511 511
         }
512 512
 
513 513
         $this->fieldVisibility = $visibility;
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
     protected function generateEntityNamespace(ClassMetadata $metadata)
606 606
     {
607 607
         if ($this->hasNamespace($metadata)) {
608
-            return 'namespace ' . $this->getNamespace($metadata) .';';
608
+            return 'namespace '.$this->getNamespace($metadata).';';
609 609
         }
610 610
     }
611 611
 
@@ -625,8 +625,8 @@  discard block
 block discarded – undo
625 625
      */
626 626
     protected function generateEntityClassName(ClassMetadata $metadata)
627 627
     {
628
-        return 'class ' . $this->getClassName($metadata) .
629
-            ($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null);
628
+        return 'class '.$this->getClassName($metadata).
629
+            ($this->extendsClass() ? ' extends '.$this->getClassToExtendName() : null);
630 630
     }
631 631
 
632 632
     /**
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
         $optionalFields = array();
717 717
 
718 718
         foreach ($metadata->getProperties() as $property) {
719
-            if (! $property->isNullable()) {
719
+            if ( ! $property->isNullable()) {
720 720
                 $requiredFields[] = $property;
721 721
 
722 722
                 continue;
@@ -745,13 +745,13 @@  discard block
 block discarded – undo
745 745
             $fieldName  = $property->getName();
746 746
             $fieldType  = $property->getTypeName();
747 747
             $mappedType = $this->getType($fieldType);
748
-            $param      = '$' . $fieldName;
748
+            $param      = '$'.$fieldName;
749 749
 
750
-            $paramTypes[] = $mappedType . ($property->isNullable() ? '|null' : '');
750
+            $paramTypes[] = $mappedType.($property->isNullable() ? '|null' : '');
751 751
             $paramVariables[] = $param;
752 752
 
753 753
             if ($fieldType === 'datetime') {
754
-                $param = $mappedType . ' ' . $param;
754
+                $param = $mappedType.' '.$param;
755 755
             }
756 756
 
757 757
             if ($property->isNullable()) {
@@ -760,13 +760,13 @@  discard block
 block discarded – undo
760 760
 
761 761
             $params[] = $param;
762 762
 
763
-            $fields[] = '$this->' . $fieldName . ' = $' . $fieldName . ';';
763
+            $fields[] = '$this->'.$fieldName.' = $'.$fieldName.';';
764 764
         }
765 765
 
766 766
         $maxParamTypeLength = max(array_map('strlen', $paramTypes));
767 767
         $paramTags = array_map(
768
-            function ($type, $variable) use ($maxParamTypeLength) {
769
-                return '@param ' . $type . str_repeat(' ', $maxParamTypeLength - strlen($type) + 1) . $variable;
768
+            function($type, $variable) use ($maxParamTypeLength) {
769
+                return '@param '.$type.str_repeat(' ', $maxParamTypeLength - strlen($type) + 1).$variable;
770 770
             },
771 771
             $paramTypes,
772 772
             $paramVariables
@@ -774,8 +774,8 @@  discard block
 block discarded – undo
774 774
 
775 775
         // Generate multi line constructor if the signature exceeds 120 characters.
776 776
         if (array_sum(array_map('strlen', $params)) + count($params) * 2 + 29 > 120) {
777
-            $delimiter = "\n" . $this->spaces;
778
-            $params = $delimiter . implode(',' . $delimiter, $params) . "\n";
777
+            $delimiter = "\n".$this->spaces;
778
+            $params = $delimiter.implode(','.$delimiter, $params)."\n";
779 779
         } else {
780 780
             $params = implode(', ', $params);
781 781
         }
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
         $replacements = array(
784 784
             '<paramTags>' => implode("\n * ", $paramTags),
785 785
             '<params>'    => $params,
786
-            '<fields>'    => implode("\n" . $this->spaces, $fields),
786
+            '<fields>'    => implode("\n".$this->spaces, $fields),
787 787
         );
788 788
 
789 789
         $constructor = str_replace(
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
 
828 828
             if ($inClass) {
829 829
                 $inClass = false;
830
-                $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1];
830
+                $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1];
831 831
                 $this->staticReflection[$lastSeenClass]['properties'] = array();
832 832
                 $this->staticReflection[$lastSeenClass]['methods'] = array();
833 833
             }
@@ -835,16 +835,16 @@  discard block
 block discarded – undo
835 835
             if ($token[0] == T_NAMESPACE) {
836 836
                 $lastSeenNamespace = "";
837 837
                 $inNamespace = true;
838
-            } elseif ($token[0] == T_CLASS && $tokens[$i-1][0] != T_DOUBLE_COLON) {
838
+            } elseif ($token[0] == T_CLASS && $tokens[$i - 1][0] != T_DOUBLE_COLON) {
839 839
                 $inClass = true;
840 840
             } elseif ($token[0] == T_FUNCTION) {
841
-                if ($tokens[$i+2][0] == T_STRING) {
842
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]);
843
-                } elseif ($tokens[$i+2] == "&" && $tokens[$i+3][0] == T_STRING) {
844
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]);
841
+                if ($tokens[$i + 2][0] == T_STRING) {
842
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]);
843
+                } elseif ($tokens[$i + 2] == "&" && $tokens[$i + 3][0] == T_STRING) {
844
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]);
845 845
                 }
846
-            } elseif (in_array($token[0], array(T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED)) && $tokens[$i+2][0] != T_FUNCTION) {
847
-                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1);
846
+            } elseif (in_array($token[0], array(T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED)) && $tokens[$i + 2][0] != T_FUNCTION) {
847
+                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1);
848 848
             }
849 849
         }
850 850
     }
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
      */
858 858
     protected function hasProperty($property, ClassMetadata $metadata)
859 859
     {
860
-        if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) {
860
+        if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) {
861 861
             // don't generate property if its already on the base class.
862 862
             $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name);
863 863
             if ($reflClass->hasProperty($property)) {
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
      */
887 887
     protected function hasMethod($method, ClassMetadata $metadata)
888 888
     {
889
-        if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) {
889
+        if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) {
890 890
             // don't generate method if its already on the base class.
891 891
             $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name);
892 892
 
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
      */
916 916
     protected function getTraits(ClassMetadata $metadata)
917 917
     {
918
-        if (! ($metadata->reflClass !== null || class_exists($metadata->name))) {
918
+        if ( ! ($metadata->reflClass !== null || class_exists($metadata->name))) {
919 919
             return [];
920 920
         }
921 921
 
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
     {
968 968
         $refl = new \ReflectionClass($this->getClassToExtend());
969 969
 
970
-        return '\\' . $refl->getName();
970
+        return '\\'.$refl->getName();
971 971
     }
972 972
 
973 973
     /**
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
     {
1001 1001
         $lines = array();
1002 1002
         $lines[] = '/**';
1003
-        $lines[] = ' * ' . $this->getClassName($metadata);
1003
+        $lines[] = ' * '.$this->getClassName($metadata);
1004 1004
 
1005 1005
         if ($this->generateAnnotations) {
1006 1006
             $lines[] = ' *';
@@ -1015,12 +1015,12 @@  discard block
 block discarded – undo
1015 1015
 
1016 1016
             foreach ($methods as $method) {
1017 1017
                 if ($code = $this->$method($metadata)) {
1018
-                    $lines[] = ' * ' . $code;
1018
+                    $lines[] = ' * '.$code;
1019 1019
                 }
1020 1020
             }
1021 1021
 
1022 1022
             if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) {
1023
-                $lines[] = ' * @' . $this->annotationsPrefix . 'HasLifecycleCallbacks';
1023
+                $lines[] = ' * @'.$this->annotationsPrefix.'HasLifecycleCallbacks';
1024 1024
             }
1025 1025
         }
1026 1026
 
@@ -1036,17 +1036,17 @@  discard block
 block discarded – undo
1036 1036
      */
1037 1037
     protected function generateEntityAnnotation(ClassMetadata $metadata)
1038 1038
     {
1039
-        $prefix = '@' . $this->annotationsPrefix;
1039
+        $prefix = '@'.$this->annotationsPrefix;
1040 1040
 
1041 1041
         if ($metadata->isEmbeddedClass) {
1042
-            return $prefix . 'Embeddable';
1042
+            return $prefix.'Embeddable';
1043 1043
         }
1044 1044
 
1045 1045
         $customRepository = $metadata->customRepositoryClassName
1046
-            ? '(repositoryClass="' . $metadata->customRepositoryClassName . '")'
1046
+            ? '(repositoryClass="'.$metadata->customRepositoryClassName.'")'
1047 1047
             : '';
1048 1048
 
1049
-        return $prefix . ($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity') . $customRepository;
1049
+        return $prefix.($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity').$customRepository;
1050 1050
     }
1051 1051
 
1052 1052
     /**
@@ -1063,28 +1063,28 @@  discard block
 block discarded – undo
1063 1063
         $table = array();
1064 1064
 
1065 1065
         if (isset($metadata->table['schema'])) {
1066
-            $table[] = 'schema="' . $metadata->table['schema'] . '"';
1066
+            $table[] = 'schema="'.$metadata->table['schema'].'"';
1067 1067
         }
1068 1068
 
1069 1069
         if (isset($metadata->table['name'])) {
1070
-            $table[] = 'name="' . $metadata->table['name'] . '"';
1070
+            $table[] = 'name="'.$metadata->table['name'].'"';
1071 1071
         }
1072 1072
 
1073 1073
         if (isset($metadata->table['options']) && $metadata->table['options']) {
1074
-            $table[] = 'options={' . $this->exportTableOptions((array) $metadata->table['options']) . '}';
1074
+            $table[] = 'options={'.$this->exportTableOptions((array) $metadata->table['options']).'}';
1075 1075
         }
1076 1076
 
1077 1077
         if (isset($metadata->table['uniqueConstraints']) && $metadata->table['uniqueConstraints']) {
1078 1078
             $constraints = $this->generateTableConstraints('UniqueConstraint', $metadata->table['uniqueConstraints']);
1079
-            $table[] = 'uniqueConstraints={' . $constraints . '}';
1079
+            $table[] = 'uniqueConstraints={'.$constraints.'}';
1080 1080
         }
1081 1081
 
1082 1082
         if (isset($metadata->table['indexes']) && $metadata->table['indexes']) {
1083 1083
             $constraints = $this->generateTableConstraints('Index', $metadata->table['indexes']);
1084
-            $table[] = 'indexes={' . $constraints . '}';
1084
+            $table[] = 'indexes={'.$constraints.'}';
1085 1085
         }
1086 1086
 
1087
-        return '@' . $this->annotationsPrefix . 'Table(' . implode(', ', $table) . ')';
1087
+        return '@'.$this->annotationsPrefix.'Table('.implode(', ', $table).')';
1088 1088
     }
1089 1089
 
1090 1090
     /**
@@ -1101,10 +1101,10 @@  discard block
 block discarded – undo
1101 1101
             $columns = array();
1102 1102
 
1103 1103
             foreach ($constraint['columns'] as $column) {
1104
-                $columns[] = '"' . $column . '"';
1104
+                $columns[] = '"'.$column.'"';
1105 1105
             }
1106 1106
 
1107
-            $annotations[] = '@' . $this->annotationsPrefix . $constraintName . '(name="' . $name . '", columns={' . implode(', ', $columns) . '})';
1107
+            $annotations[] = '@'.$this->annotationsPrefix.$constraintName.'(name="'.$name.'", columns={'.implode(', ', $columns).'})';
1108 1108
         }
1109 1109
 
1110 1110
         return implode(', ', $annotations);
@@ -1118,7 +1118,7 @@  discard block
 block discarded – undo
1118 1118
     protected function generateInheritanceAnnotation(ClassMetadata $metadata)
1119 1119
     {
1120 1120
         if ($metadata->inheritanceType != ClassMetadata::INHERITANCE_TYPE_NONE) {
1121
-            return '@' . $this->annotationsPrefix . 'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")';
1121
+            return '@'.$this->annotationsPrefix.'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")';
1122 1122
         }
1123 1123
     }
1124 1124
 
@@ -1139,7 +1139,7 @@  discard block
 block discarded – undo
1139 1139
                 $discrColumn->getLength()
1140 1140
             );
1141 1141
 
1142
-            return '@' . $this->annotationsPrefix . 'DiscriminatorColumn(' . $columnDefinition . ')';
1142
+            return '@'.$this->annotationsPrefix.'DiscriminatorColumn('.$columnDefinition.')';
1143 1143
         }
1144 1144
     }
1145 1145
 
@@ -1154,10 +1154,10 @@  discard block
 block discarded – undo
1154 1154
             $inheritanceClassMap = array();
1155 1155
 
1156 1156
             foreach ($metadata->discriminatorMap as $type => $class) {
1157
-                $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"';
1157
+                $inheritanceClassMap[] .= '"'.$type.'" = "'.$class.'"';
1158 1158
             }
1159 1159
 
1160
-            return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})';
1160
+            return '@'.$this->annotationsPrefix.'DiscriminatorMap({'.implode(', ', $inheritanceClassMap).'})';
1161 1161
         }
1162 1162
     }
1163 1163
 
@@ -1249,7 +1249,7 @@  discard block
 block discarded – undo
1249 1249
         }
1250 1250
 
1251 1251
         foreach ($joinColumns as $joinColumn) {
1252
-            if (isset($joinColumn['nullable']) && !$joinColumn['nullable']) {
1252
+            if (isset($joinColumn['nullable']) && ! $joinColumn['nullable']) {
1253 1253
                 return false;
1254 1254
             }
1255 1255
         }
@@ -1296,8 +1296,8 @@  discard block
 block discarded – undo
1296 1296
             }
1297 1297
 
1298 1298
             $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata);
1299
-            $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName']
1300
-                     . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n";
1299
+            $lines[] = $this->spaces.$this->fieldVisibility.' $'.$associationMapping['fieldName']
1300
+                     . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null).";\n";
1301 1301
         }
1302 1302
 
1303 1303
         return implode("\n", $lines);
@@ -1326,8 +1326,8 @@  discard block
 block discarded – undo
1326 1326
             $options = $property->getOptions();
1327 1327
 
1328 1328
             $lines[] = $this->generateFieldMappingPropertyDocBlock($property, $metadata);
1329
-            $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldName
1330
-                     . (isset($options['default']) ? ' = ' . var_export($options['default'], true) : null) . ";\n";
1329
+            $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldName
1330
+                     . (isset($options['default']) ? ' = '.var_export($options['default'], true) : null).";\n";
1331 1331
         }
1332 1332
 
1333 1333
         return implode("\n", $lines);
@@ -1363,9 +1363,9 @@  discard block
 block discarded – undo
1363 1363
      *
1364 1364
      * @return string
1365 1365
      */
1366
-    protected function generateEntityStubMethod(ClassMetadata $metadata, $type, $fieldName, $typeHint = null,  $defaultValue = null)
1366
+    protected function generateEntityStubMethod(ClassMetadata $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null)
1367 1367
     {
1368
-        $methodName = $type . Inflector::classify($fieldName);
1368
+        $methodName = $type.Inflector::classify($fieldName);
1369 1369
         $variableName = Inflector::camelize($fieldName);
1370 1370
 
1371 1371
         if (in_array($type, array("add", "remove"))) {
@@ -1386,18 +1386,18 @@  discard block
 block discarded – undo
1386 1386
         $variableType   = $typeHint ? $this->getType($typeHint) : null;
1387 1387
 
1388 1388
         if ($typeHint && ! isset($types[$typeHint])) {
1389
-            $variableType   =  '\\' . ltrim($variableType, '\\');
1390
-            $methodTypeHint =  '\\' . $typeHint . ' ';
1389
+            $variableType   = '\\'.ltrim($variableType, '\\');
1390
+            $methodTypeHint = '\\'.$typeHint.' ';
1391 1391
         }
1392 1392
 
1393 1393
         $replacements = array(
1394
-          '<description>'       => ucfirst($type) . ' ' . $variableName,
1394
+          '<description>'       => ucfirst($type).' '.$variableName,
1395 1395
           '<methodTypeHint>'    => $methodTypeHint,
1396 1396
           '<variableType>'      => $variableType,
1397 1397
           '<variableName>'      => $variableName,
1398 1398
           '<methodName>'        => $methodName,
1399 1399
           '<fieldName>'         => $fieldName,
1400
-          '<variableDefault>'   => ($defaultValue !== null ) ? (' = '.$defaultValue) : '',
1400
+          '<variableDefault>'   => ($defaultValue !== null) ? (' = '.$defaultValue) : '',
1401 1401
           '<entity>'            => $this->getClassName($metadata)
1402 1402
         );
1403 1403
 
@@ -1425,7 +1425,7 @@  discard block
 block discarded – undo
1425 1425
         $this->staticReflection[$metadata->name]['methods'][] = $methodName;
1426 1426
 
1427 1427
         $replacements = array(
1428
-            '<name>'        => $this->annotationsPrefix . ucfirst($name),
1428
+            '<name>'        => $this->annotationsPrefix.ucfirst($name),
1429 1429
             '<methodName>'  => $methodName,
1430 1430
         );
1431 1431
 
@@ -1448,30 +1448,30 @@  discard block
 block discarded – undo
1448 1448
         $joinColumnAnnot = array();
1449 1449
 
1450 1450
         if (isset($joinColumn['name'])) {
1451
-            $joinColumnAnnot[] = 'name="' . $joinColumn['name'] . '"';
1451
+            $joinColumnAnnot[] = 'name="'.$joinColumn['name'].'"';
1452 1452
         }
1453 1453
 
1454 1454
         if (isset($joinColumn['referencedColumnName'])) {
1455
-            $joinColumnAnnot[] = 'referencedColumnName="' . $joinColumn['referencedColumnName'] . '"';
1455
+            $joinColumnAnnot[] = 'referencedColumnName="'.$joinColumn['referencedColumnName'].'"';
1456 1456
         }
1457 1457
 
1458 1458
         if (isset($joinColumn['unique']) && $joinColumn['unique']) {
1459
-            $joinColumnAnnot[] = 'unique=' . ($joinColumn['unique'] ? 'true' : 'false');
1459
+            $joinColumnAnnot[] = 'unique='.($joinColumn['unique'] ? 'true' : 'false');
1460 1460
         }
1461 1461
 
1462 1462
         if (isset($joinColumn['nullable'])) {
1463
-            $joinColumnAnnot[] = 'nullable=' . ($joinColumn['nullable'] ? 'true' : 'false');
1463
+            $joinColumnAnnot[] = 'nullable='.($joinColumn['nullable'] ? 'true' : 'false');
1464 1464
         }
1465 1465
 
1466 1466
         if (isset($joinColumn['onDelete'])) {
1467
-            $joinColumnAnnot[] = 'onDelete="' . ($joinColumn['onDelete'] . '"');
1467
+            $joinColumnAnnot[] = 'onDelete="'.($joinColumn['onDelete'].'"');
1468 1468
         }
1469 1469
 
1470 1470
         if (isset($joinColumn['columnDefinition'])) {
1471
-            $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn['columnDefinition'] . '"';
1471
+            $joinColumnAnnot[] = 'columnDefinition="'.$joinColumn['columnDefinition'].'"';
1472 1472
         }
1473 1473
 
1474
-        return '@' . $this->annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')';
1474
+        return '@'.$this->annotationsPrefix.'JoinColumn('.implode(', ', $joinColumnAnnot).')';
1475 1475
     }
1476 1476
 
1477 1477
     /**
@@ -1483,22 +1483,22 @@  discard block
 block discarded – undo
1483 1483
     protected function generateAssociationMappingPropertyDocBlock(array $associationMapping, ClassMetadata $metadata)
1484 1484
     {
1485 1485
         $lines = array();
1486
-        $lines[] = $this->spaces . '/**';
1486
+        $lines[] = $this->spaces.'/**';
1487 1487
 
1488 1488
         if ($associationMapping['type'] & ClassMetadata::TO_MANY) {
1489
-            $lines[] = $this->spaces . ' * @var \Doctrine\Common\Collections\Collection';
1489
+            $lines[] = $this->spaces.' * @var \Doctrine\Common\Collections\Collection';
1490 1490
         } else {
1491
-            $lines[] = $this->spaces . ' * @var \\' . ltrim($associationMapping['targetEntity'], '\\');
1491
+            $lines[] = $this->spaces.' * @var \\'.ltrim($associationMapping['targetEntity'], '\\');
1492 1492
         }
1493 1493
 
1494 1494
         if ($this->generateAnnotations) {
1495
-            $lines[] = $this->spaces . ' *';
1495
+            $lines[] = $this->spaces.' *';
1496 1496
 
1497 1497
             if (isset($associationMapping['id']) && $associationMapping['id']) {
1498
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id';
1498
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id';
1499 1499
 
1500 1500
                 if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) {
1501
-                    $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")';
1501
+                    $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")';
1502 1502
                 }
1503 1503
             }
1504 1504
 
@@ -1522,15 +1522,15 @@  discard block
 block discarded – undo
1522 1522
             $typeOptions = array();
1523 1523
 
1524 1524
             if (isset($associationMapping['targetEntity'])) {
1525
-                $typeOptions[] = 'targetEntity="' . $associationMapping['targetEntity'] . '"';
1525
+                $typeOptions[] = 'targetEntity="'.$associationMapping['targetEntity'].'"';
1526 1526
             }
1527 1527
 
1528 1528
             if (isset($associationMapping['inversedBy'])) {
1529
-                $typeOptions[] = 'inversedBy="' . $associationMapping['inversedBy'] . '"';
1529
+                $typeOptions[] = 'inversedBy="'.$associationMapping['inversedBy'].'"';
1530 1530
             }
1531 1531
 
1532 1532
             if (isset($associationMapping['mappedBy'])) {
1533
-                $typeOptions[] = 'mappedBy="' . $associationMapping['mappedBy'] . '"';
1533
+                $typeOptions[] = 'mappedBy="'.$associationMapping['mappedBy'].'"';
1534 1534
             }
1535 1535
 
1536 1536
             if ($associationMapping['cascade']) {
@@ -1546,11 +1546,11 @@  discard block
 block discarded – undo
1546 1546
                     $cascades = array('"all"');
1547 1547
                 }
1548 1548
 
1549
-                $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}';
1549
+                $typeOptions[] = 'cascade={'.implode(',', $cascades).'}';
1550 1550
             }
1551 1551
 
1552 1552
             if (isset($associationMapping['orphanRemoval']) && $associationMapping['orphanRemoval']) {
1553
-                $typeOptions[] = 'orphanRemoval=' . ($associationMapping['orphanRemoval'] ? 'true' : 'false');
1553
+                $typeOptions[] = 'orphanRemoval='.($associationMapping['orphanRemoval'] ? 'true' : 'false');
1554 1554
             }
1555 1555
 
1556 1556
             if (isset($associationMapping['fetch']) && $associationMapping['fetch'] !== ClassMetadata::FETCH_LAZY) {
@@ -1559,71 +1559,71 @@  discard block
 block discarded – undo
1559 1559
                     ClassMetadata::FETCH_EAGER      => 'EAGER',
1560 1560
                 );
1561 1561
 
1562
-                $typeOptions[] = 'fetch="' . $fetchMap[$associationMapping['fetch']] . '"';
1562
+                $typeOptions[] = 'fetch="'.$fetchMap[$associationMapping['fetch']].'"';
1563 1563
             }
1564 1564
 
1565
-            $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')';
1565
+            $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.''.$type.'('.implode(', ', $typeOptions).')';
1566 1566
 
1567 1567
             if (isset($associationMapping['joinColumns']) && $associationMapping['joinColumns']) {
1568
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinColumns({';
1568
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinColumns({';
1569 1569
 
1570 1570
                 $joinColumnsLines = array();
1571 1571
 
1572 1572
                 foreach ($associationMapping['joinColumns'] as $joinColumn) {
1573 1573
                     if ($joinColumnAnnot = $this->generateJoinColumnAnnotation($joinColumn)) {
1574
-                        $joinColumnsLines[] = $this->spaces . ' *   ' . $joinColumnAnnot;
1574
+                        $joinColumnsLines[] = $this->spaces.' *   '.$joinColumnAnnot;
1575 1575
                     }
1576 1576
                 }
1577 1577
 
1578 1578
                 $lines[] = implode(",\n", $joinColumnsLines);
1579
-                $lines[] = $this->spaces . ' * })';
1579
+                $lines[] = $this->spaces.' * })';
1580 1580
             }
1581 1581
 
1582 1582
             if (isset($associationMapping['joinTable']) && $associationMapping['joinTable']) {
1583 1583
                 $joinTable = array();
1584
-                $joinTable[] = 'name="' . $associationMapping['joinTable']['name'] . '"';
1584
+                $joinTable[] = 'name="'.$associationMapping['joinTable']['name'].'"';
1585 1585
 
1586 1586
                 if (isset($associationMapping['joinTable']['schema'])) {
1587
-                    $joinTable[] = 'schema="' . $associationMapping['joinTable']['schema'] . '"';
1587
+                    $joinTable[] = 'schema="'.$associationMapping['joinTable']['schema'].'"';
1588 1588
                 }
1589 1589
 
1590
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinTable(' . implode(', ', $joinTable) . ',';
1591
-                $lines[] = $this->spaces . ' *   joinColumns={';
1590
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinTable('.implode(', ', $joinTable).',';
1591
+                $lines[] = $this->spaces.' *   joinColumns={';
1592 1592
 
1593 1593
                 $joinColumnsLines = array();
1594 1594
 
1595 1595
                 foreach ($associationMapping['joinTable']['joinColumns'] as $joinColumn) {
1596
-                    $joinColumnsLines[] = $this->spaces . ' *     ' . $this->generateJoinColumnAnnotation($joinColumn);
1596
+                    $joinColumnsLines[] = $this->spaces.' *     '.$this->generateJoinColumnAnnotation($joinColumn);
1597 1597
                 }
1598 1598
 
1599
-                $lines[] = implode(",". PHP_EOL, $joinColumnsLines);
1600
-                $lines[] = $this->spaces . ' *   },';
1601
-                $lines[] = $this->spaces . ' *   inverseJoinColumns={';
1599
+                $lines[] = implode(",".PHP_EOL, $joinColumnsLines);
1600
+                $lines[] = $this->spaces.' *   },';
1601
+                $lines[] = $this->spaces.' *   inverseJoinColumns={';
1602 1602
 
1603 1603
                 $inverseJoinColumnsLines = array();
1604 1604
 
1605 1605
                 foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $joinColumn) {
1606
-                    $inverseJoinColumnsLines[] = $this->spaces . ' *     ' . $this->generateJoinColumnAnnotation($joinColumn);
1606
+                    $inverseJoinColumnsLines[] = $this->spaces.' *     '.$this->generateJoinColumnAnnotation($joinColumn);
1607 1607
                 }
1608 1608
 
1609
-                $lines[] = implode(",". PHP_EOL, $inverseJoinColumnsLines);
1610
-                $lines[] = $this->spaces . ' *   }';
1611
-                $lines[] = $this->spaces . ' * )';
1609
+                $lines[] = implode(",".PHP_EOL, $inverseJoinColumnsLines);
1610
+                $lines[] = $this->spaces.' *   }';
1611
+                $lines[] = $this->spaces.' * )';
1612 1612
             }
1613 1613
 
1614 1614
             if (isset($associationMapping['orderBy'])) {
1615
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'OrderBy({';
1615
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'OrderBy({';
1616 1616
 
1617 1617
                 foreach ($associationMapping['orderBy'] as $name => $direction) {
1618
-                    $lines[] = $this->spaces . ' *     "' . $name . '"="' . $direction . '",';
1618
+                    $lines[] = $this->spaces.' *     "'.$name.'"="'.$direction.'",';
1619 1619
                 }
1620 1620
 
1621 1621
                 $lines[count($lines) - 1] = substr($lines[count($lines) - 1], 0, strlen($lines[count($lines) - 1]) - 1);
1622
-                $lines[] = $this->spaces . ' * })';
1622
+                $lines[] = $this->spaces.' * })';
1623 1623
             }
1624 1624
         }
1625 1625
 
1626
-        $lines[] = $this->spaces . ' */';
1626
+        $lines[] = $this->spaces.' */';
1627 1627
 
1628 1628
         return implode("\n", $lines);
1629 1629
     }
@@ -1640,41 +1640,41 @@  discard block
 block discarded – undo
1640 1640
 
1641 1641
         $lines = array();
1642 1642
 
1643
-        $lines[] = $this->spaces . '/**';
1644
-        $lines[] = $this->spaces . ' * @var ' . $this->getType($fieldType);
1643
+        $lines[] = $this->spaces.'/**';
1644
+        $lines[] = $this->spaces.' * @var '.$this->getType($fieldType);
1645 1645
 
1646 1646
         if ($this->generateAnnotations) {
1647 1647
             $column  = array();
1648
-            $lines[] = $this->spaces . ' *';
1648
+            $lines[] = $this->spaces.' *';
1649 1649
 
1650 1650
             if ($propertyMetadata->getColumnName()) {
1651
-                $column[] = 'name="' . $propertyMetadata->getColumnName() . '"';
1651
+                $column[] = 'name="'.$propertyMetadata->getColumnName().'"';
1652 1652
             }
1653 1653
 
1654
-            $column[] = 'type="' . $fieldType . '"';
1654
+            $column[] = 'type="'.$fieldType.'"';
1655 1655
 
1656 1656
             if (is_int($propertyMetadata->getLength())) {
1657
-                $column[] = 'length=' . $propertyMetadata->getLength();
1657
+                $column[] = 'length='.$propertyMetadata->getLength();
1658 1658
             }
1659 1659
 
1660 1660
             if (is_int($propertyMetadata->getPrecision())) {
1661
-                $column[] = 'precision=' .  $propertyMetadata->getPrecision();
1661
+                $column[] = 'precision='.$propertyMetadata->getPrecision();
1662 1662
             }
1663 1663
 
1664 1664
             if (is_int($propertyMetadata->getScale())) {
1665
-                $column[] = 'scale=' .  $propertyMetadata->getScale();
1665
+                $column[] = 'scale='.$propertyMetadata->getScale();
1666 1666
             }
1667 1667
 
1668 1668
             if ($propertyMetadata->isNullable()) {
1669
-                $column[] = 'nullable=' .  var_export($propertyMetadata->isNullable(), true);
1669
+                $column[] = 'nullable='.var_export($propertyMetadata->isNullable(), true);
1670 1670
             }
1671 1671
 
1672 1672
             if ($propertyMetadata->isUnique()) {
1673
-                $column[] = 'unique=' . var_export($propertyMetadata->isUnique(), true);
1673
+                $column[] = 'unique='.var_export($propertyMetadata->isUnique(), true);
1674 1674
             }
1675 1675
 
1676 1676
             if ($propertyMetadata->getColumnDefinition()) {
1677
-                $column[] = 'columnDefinition="' . $propertyMetadata->getColumnDefinition() . '"';
1677
+                $column[] = 'columnDefinition="'.$propertyMetadata->getColumnDefinition().'"';
1678 1678
             }
1679 1679
 
1680 1680
             $options = [];
@@ -1689,40 +1689,40 @@  discard block
 block discarded – undo
1689 1689
                 $column[] = 'options={'.implode(',', $options).'}';
1690 1690
             }
1691 1691
 
1692
-            $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Column(' . implode(', ', $column) . ')';
1692
+            $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Column('.implode(', ', $column).')';
1693 1693
 
1694 1694
             if ($propertyMetadata->isPrimaryKey()) {
1695
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id';
1695
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id';
1696 1696
 
1697 1697
                 if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) {
1698
-                    $lines[] = $this->spaces.' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")';
1698
+                    $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")';
1699 1699
                 }
1700 1700
 
1701 1701
                 if ($metadata->sequenceGeneratorDefinition) {
1702 1702
                     $sequenceGenerator = array();
1703 1703
 
1704 1704
                     if (isset($metadata->sequenceGeneratorDefinition['sequenceName'])) {
1705
-                        $sequenceGenerator[] = 'sequenceName="' . $metadata->sequenceGeneratorDefinition['sequenceName'] . '"';
1705
+                        $sequenceGenerator[] = 'sequenceName="'.$metadata->sequenceGeneratorDefinition['sequenceName'].'"';
1706 1706
                     }
1707 1707
 
1708 1708
                     if (isset($metadata->sequenceGeneratorDefinition['allocationSize'])) {
1709
-                        $sequenceGenerator[] = 'allocationSize=' . $metadata->sequenceGeneratorDefinition['allocationSize'];
1709
+                        $sequenceGenerator[] = 'allocationSize='.$metadata->sequenceGeneratorDefinition['allocationSize'];
1710 1710
                     }
1711 1711
 
1712 1712
                     if (isset($metadata->sequenceGeneratorDefinition['initialValue'])) {
1713
-                        $sequenceGenerator[] = 'initialValue=' . $metadata->sequenceGeneratorDefinition['initialValue'];
1713
+                        $sequenceGenerator[] = 'initialValue='.$metadata->sequenceGeneratorDefinition['initialValue'];
1714 1714
                     }
1715 1715
 
1716
-                    $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'SequenceGenerator(' . implode(', ', $sequenceGenerator) . ')';
1716
+                    $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'SequenceGenerator('.implode(', ', $sequenceGenerator).')';
1717 1717
                 }
1718 1718
             }
1719 1719
 
1720 1720
             if ($metadata->isVersioned() && $metadata->versionProperty->getName() === $propertyMetadata->getName()) {
1721
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Version';
1721
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Version';
1722 1722
             }
1723 1723
         }
1724 1724
 
1725
-        $lines[] = $this->spaces . ' */';
1725
+        $lines[] = $this->spaces.' */';
1726 1726
 
1727 1727
         return implode("\n", $lines);
1728 1728
     }
@@ -1735,23 +1735,23 @@  discard block
 block discarded – undo
1735 1735
     protected function generateEmbeddedPropertyDocBlock(array $embeddedClass)
1736 1736
     {
1737 1737
         $lines = array();
1738
-        $lines[] = $this->spaces . '/**';
1739
-        $lines[] = $this->spaces . ' * @var \\' . ltrim($embeddedClass['class'], '\\');
1738
+        $lines[] = $this->spaces.'/**';
1739
+        $lines[] = $this->spaces.' * @var \\'.ltrim($embeddedClass['class'], '\\');
1740 1740
 
1741 1741
         if ($this->generateAnnotations) {
1742
-            $lines[] = $this->spaces . ' *';
1742
+            $lines[] = $this->spaces.' *';
1743 1743
 
1744
-            $embedded = array('class="' . $embeddedClass['class'] . '"');
1744
+            $embedded = array('class="'.$embeddedClass['class'].'"');
1745 1745
 
1746 1746
             if (isset($fieldMapping['columnPrefix'])) {
1747
-                $embedded[] = 'columnPrefix=' . var_export($embeddedClass['columnPrefix'], true);
1747
+                $embedded[] = 'columnPrefix='.var_export($embeddedClass['columnPrefix'], true);
1748 1748
             }
1749 1749
 
1750
-            $lines[] = $this->spaces . ' * @' .
1751
-                $this->annotationsPrefix . 'Embedded(' . implode(', ', $embedded) . ')';
1750
+            $lines[] = $this->spaces.' * @'.
1751
+                $this->annotationsPrefix.'Embedded('.implode(', ', $embedded).')';
1752 1752
         }
1753 1753
 
1754
-        $lines[] = $this->spaces . ' */';
1754
+        $lines[] = $this->spaces.' */';
1755 1755
 
1756 1756
         return implode("\n", $lines);
1757 1757
     }
@@ -1768,7 +1768,7 @@  discard block
 block discarded – undo
1768 1768
 
1769 1769
         foreach ($lines as $key => $value) {
1770 1770
             if ( ! empty($value)) {
1771
-                $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key];
1771
+                $lines[$key] = str_repeat($this->spaces, $num).$lines[$key];
1772 1772
             }
1773 1773
         }
1774 1774
 
@@ -1836,9 +1836,9 @@  discard block
 block discarded – undo
1836 1836
 
1837 1837
         foreach ($options as $name => $option) {
1838 1838
             if (is_array($option)) {
1839
-                $optionsStr[] = '"' . $name . '"={' . $this->exportTableOptions($option) . '}';
1839
+                $optionsStr[] = '"'.$name.'"={'.$this->exportTableOptions($option).'}';
1840 1840
             } else {
1841
-                $optionsStr[] = '"' . $name . '"="' . (string) $option . '"';
1841
+                $optionsStr[] = '"'.$name.'"="'.(string) $option.'"';
1842 1842
             }
1843 1843
         }
1844 1844
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/SchemaTool.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
                 $pkColumns = array();
191 191
 
192 192
                 foreach ($class->getProperties() as $fieldName => $property) {
193
-                    if (! $class->isInheritedProperty($fieldName)) {
193
+                    if ( ! $class->isInheritedProperty($fieldName)) {
194 194
                         $columnName = $this->platform->quoteIdentifier($property->getColumnName());
195 195
 
196 196
                         $this->gatherColumn($class, $property, $table);
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
             }
333 333
         }
334 334
 
335
-        if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas() ) {
335
+        if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) {
336 336
             $schema->visit(new RemoveNamespacedAssets());
337 337
         }
338 338
 
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
                 break;
376 376
         }
377 377
 
378
-        if (!empty($discrColumn->getColumnDefinition())) {
378
+        if ( ! empty($discrColumn->getColumnDefinition())) {
379 379
             $options['columnDefinition'] = $discrColumn->getColumnDefinition();
380 380
         }
381 381
 
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 
410 410
         // For now, this is a hack required for single table inheritance, since this method is called
411 411
         // twice by single table inheritance relations
412
-        if (!$table->hasIndex('primary')) {
412
+        if ( ! $table->hasIndex('primary')) {
413 413
             //$table->setPrimaryKey($pkColumns);
414 414
         }
415 415
     }
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
                 $columnType    = $property->getTypeName();
686 686
 
687 687
                 if (isset($joinColumn['nullable'])) {
688
-                    $columnOptions['notnull'] = !$joinColumn['nullable'];
688
+                    $columnOptions['notnull'] = ! $joinColumn['nullable'];
689 689
                 }
690 690
 
691 691
                 if ($property->getOptions()) {
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
                 }
737 737
             }
738 738
             $blacklistedFks[$compositeName] = true;
739
-        } elseif (!isset($blacklistedFks[$compositeName])) {
739
+        } elseif ( ! isset($blacklistedFks[$compositeName])) {
740 740
             $addedFks[$compositeName] = array('foreignTableName' => $foreignTableName, 'foreignColumns' => $foreignColumns);
741 741
             $theJoinTable->addUnnamedForeignKeyConstraint(
742 742
                 $foreignTableName,
@@ -843,7 +843,7 @@  discard block
 block discarded – undo
843 843
                 if ($table->hasPrimaryKey()) {
844 844
                     $columns = $table->getPrimaryKey()->getColumns();
845 845
                     if (count($columns) == 1) {
846
-                        $checkSequence = $table->getName() . "_" . $columns[0] . "_seq";
846
+                        $checkSequence = $table->getName()."_".$columns[0]."_seq";
847 847
                         if ($fullSchema->hasSequence($checkSequence)) {
848 848
                             $visitor->acceptSequence($fullSchema->getSequence($checkSequence));
849 849
                         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -203,11 +203,11 @@  discard block
 block discarded – undo
203 203
 
204 204
         $innerSql           = $this->getInnerSQL($AST);
205 205
         $sqlIdentifier      = $this->getSQLIdentifier($AST);
206
-        $sqlAliasIdentifier = array_map(function ($info) { return $info['alias']; }, $sqlIdentifier);
206
+        $sqlAliasIdentifier = array_map(function($info) { return $info['alias']; }, $sqlIdentifier);
207 207
 
208 208
         if ($hasOrderBy) {
209
-            $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlAliasIdentifier);
210
-            $sqlPiece     = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum';
209
+            $orderGroupBy = ' GROUP BY '.implode(', ', $sqlAliasIdentifier);
210
+            $sqlPiece     = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum';
211 211
 
212 212
             $sqlAliasIdentifier[] = $sqlPiece;
213 213
             $sqlIdentifier[] = array(
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         $sql = sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result', implode(', ', $sqlAliasIdentifier), $innerSql);
221 221
 
222 222
         if ($hasOrderBy) {
223
-            $sql .= $orderGroupBy . $outerOrderBy;
223
+            $sql .= $orderGroupBy.$outerOrderBy;
224 224
         }
225 225
 
226 226
         // Apply the limit and offset.
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 
266 266
         $innerSql           = $this->getInnerSQL($AST);
267 267
         $sqlIdentifier      = $this->getSQLIdentifier($AST);
268
-        $sqlAliasIdentifier = array_map(function ($info) { return $info['alias']; }, $sqlIdentifier);
268
+        $sqlAliasIdentifier = array_map(function($info) { return $info['alias']; }, $sqlIdentifier);
269 269
 
270 270
         // Build the counter query
271 271
         $sql = sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result', implode(', ', $sqlAliasIdentifier), $innerSql);
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
     {
371 371
         // If the sql statement has an order by clause, we need to wrap it in a new select distinct
372 372
         // statement
373
-        if (! $orderByClause instanceof OrderByClause) {
373
+        if ( ! $orderByClause instanceof OrderByClause) {
374 374
             return $sql;
375 375
         }
376 376
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
         $fieldSearchPattern = '/(?<![a-z0-9_])%s\.%s(?![a-z0-9_])/i';
405 405
 
406 406
         // Generate search patterns for each field's path expression in the order by clause
407
-        foreach($this->rsm->fieldMappings as $fieldAlias => $fieldName) {
407
+        foreach ($this->rsm->fieldMappings as $fieldAlias => $fieldName) {
408 408
             $dqlAliasForFieldAlias = $this->rsm->columnOwnerMap[$fieldAlias];
409 409
             $class                 = $this->queryComponents[$dqlAliasForFieldAlias]['metadata'];
410 410
 
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 
425 425
         $orderByItems = [];
426 426
 
427
-        foreach($orderByClause->orderByItems as $orderByItem) {
427
+        foreach ($orderByClause->orderByItems as $orderByItem) {
428 428
             // Walk order by item to get string representation of it
429 429
             $orderByItemString = $this->walkOrderByItem($orderByItem);
430 430
 
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
      */
550 550
     public function walkPathExpression($pathExpr)
551 551
     {
552
-        if (!$this->inSubSelect && !$this->platformSupportsRowNumber() && !in_array($pathExpr, $this->orderByPathExpressions)) {
552
+        if ( ! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions)) {
553 553
             $this->orderByPathExpressions[] = $pathExpr;
554 554
         }
555 555
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Setup.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public static function registerAutoloadDirectory($directory)
45 45
     {
46
-        if (!class_exists('Doctrine\Common\ClassLoader', false)) {
47
-            require_once $directory . "/Doctrine/Common/ClassLoader.php";
46
+        if ( ! class_exists('Doctrine\Common\ClassLoader', false)) {
47
+            require_once $directory."/Doctrine/Common/ClassLoader.php";
48 48
         }
49 49
 
50 50
         $loader = new ClassLoader("Doctrine", $directory);
51 51
         $loader->register();
52 52
 
53
-        $loader = new ClassLoader('Symfony\Component', $directory . "/Doctrine");
53
+        $loader = new ClassLoader('Symfony\Component', $directory."/Doctrine");
54 54
         $loader->register();
55 55
     }
56 56
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         }
128 128
 
129 129
         if ($cache instanceof CacheProvider) {
130
-            $cache->setNamespace("dc2_" . md5($proxyDir) . "_"); // to avoid collisions
130
+            $cache->setNamespace("dc2_".md5($proxyDir)."_"); // to avoid collisions
131 131
         }
132 132
 
133 133
         $config = new Configuration();
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     public function exportClassMetadata(ClassMetadata $metadata)
42 42
     {
43 43
         $xml = new \SimpleXmlElement("<?xml version=\"1.0\" encoding=\"utf-8\"?><doctrine-mapping ".
44
-            "xmlns=\"http://doctrine-project.org/schemas/orm/doctrine-mapping\" " .
44
+            "xmlns=\"http://doctrine-project.org/schemas/orm/doctrine-mapping\" ".
45 45
             "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ".
46 46
             "xsi:schemaLocation=\"http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd\" />");
47 47
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
         $trackingPolicy = $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy);
109 109
 
110
-        if ( $trackingPolicy !== 'DEFERRED_IMPLICIT') {
110
+        if ($trackingPolicy !== 'DEFERRED_IMPLICIT') {
111 111
             $root->addChild('change-tracking-policy', $trackingPolicy);
112 112
         }
113 113
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 
288 288
             foreach (['remove', 'persist', 'refresh', 'merge', 'detach'] as $type) {
289 289
                 if (in_array($type, $associationMapping['cascade'])) {
290
-                    $cascades[] = 'cascade-' . $type;
290
+                    $cascades[] = 'cascade-'.$type;
291 291
                 }
292 292
             }
293 293
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
             }
382 382
         }
383 383
 
384
-        if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks)>0) {
384
+        if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks) > 0) {
385 385
             $lifecycleCallbacksXml = $root->addChild('lifecycle-callbacks');
386 386
 
387 387
             foreach ($metadata->lifecycleCallbacks as $name => $methods) {
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
     {
432 432
         $sequenceDefinition = $metadata->sequenceGeneratorDefinition;
433 433
 
434
-        if (! ($metadata->generatorType === ClassMetadata::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) {
434
+        if ( ! ($metadata->generatorType === ClassMetadata::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) {
435 435
             return;
436 436
         }
437 437
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -53,40 +53,40 @@  discard block
 block discarded – undo
53 53
         }
54 54
 
55 55
         if ($metadata->inheritanceType) {
56
-            $lines[] = '$metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_' . $this->_getInheritanceTypeString($metadata->inheritanceType) . ');';
56
+            $lines[] = '$metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_'.$this->_getInheritanceTypeString($metadata->inheritanceType).');';
57 57
         }
58 58
 
59 59
         if ($metadata->customRepositoryClassName) {
60
-            $lines[] = "\$metadata->customRepositoryClassName = '" . $metadata->customRepositoryClassName . "';";
60
+            $lines[] = "\$metadata->customRepositoryClassName = '".$metadata->customRepositoryClassName."';";
61 61
         }
62 62
 
63 63
         if ($metadata->table) {
64
-            $lines[] = '$metadata->setPrimaryTable(' . $this->_varExport($metadata->table) . ');';
64
+            $lines[] = '$metadata->setPrimaryTable('.$this->_varExport($metadata->table).');';
65 65
         }
66 66
 
67 67
         if ($metadata->discriminatorColumn) {
68 68
             $discrColumn = $metadata->discriminatorColumn;
69 69
 
70 70
             $lines[] = '$discrColumn = new Mapping\DiscriminatorColumnMetadata();';
71
-            $lines[] = '$discrColumn->setTableName("' . $discrColumn->getTableName() . '");';
72
-            $lines[] = '$discrColumn->setColumnName("' . $discrColumn->getColumnName() . '");';
73
-            $lines[] = '$discrColumn->setColumnDefinition("' . $discrColumn->getColumnDefinition() . '");';
74
-            $lines[] = '$discrColumn->setType(Type::getType("' . $discrColumn->getTypeName() . '"));';
75
-            $lines[] = '$discrColumn->setLength(' . $discrColumn->getLength() . ');';
76
-            $lines[] = '$discrColumn->setScale(' . $discrColumn->getScale() . ');';
77
-            $lines[] = '$discrColumn->setPrecision(' . $discrColumn->getPrecision() . ');';
78
-            $lines[] = '$discrColumn->setOptions(' . $this->_varExport($discrColumn->getOptions()) . ');';
79
-            $lines[] = '$discrColumn->setNullable(' . $this->_varExport($discrColumn->isNullable()) . ');';
80
-            $lines[] = '$discrColumn->setUnique(' . $this->_varExport($discrColumn->isUnique()) . ');';
71
+            $lines[] = '$discrColumn->setTableName("'.$discrColumn->getTableName().'");';
72
+            $lines[] = '$discrColumn->setColumnName("'.$discrColumn->getColumnName().'");';
73
+            $lines[] = '$discrColumn->setColumnDefinition("'.$discrColumn->getColumnDefinition().'");';
74
+            $lines[] = '$discrColumn->setType(Type::getType("'.$discrColumn->getTypeName().'"));';
75
+            $lines[] = '$discrColumn->setLength('.$discrColumn->getLength().');';
76
+            $lines[] = '$discrColumn->setScale('.$discrColumn->getScale().');';
77
+            $lines[] = '$discrColumn->setPrecision('.$discrColumn->getPrecision().');';
78
+            $lines[] = '$discrColumn->setOptions('.$this->_varExport($discrColumn->getOptions()).');';
79
+            $lines[] = '$discrColumn->setNullable('.$this->_varExport($discrColumn->isNullable()).');';
80
+            $lines[] = '$discrColumn->setUnique('.$this->_varExport($discrColumn->isUnique()).');';
81 81
             $lines[] = '$metadata->setDiscriminatorColumn($discrColumn);';
82 82
         }
83 83
 
84 84
         if ($metadata->discriminatorMap) {
85
-            $lines[] = '$metadata->setDiscriminatorMap(' . $this->_varExport($metadata->discriminatorMap) . ');';
85
+            $lines[] = '$metadata->setDiscriminatorMap('.$this->_varExport($metadata->discriminatorMap).');';
86 86
         }
87 87
 
88 88
         if ($metadata->changeTrackingPolicy) {
89
-            $lines[] = '$metadata->setChangeTrackingPolicy(ClassMetadata::CHANGETRACKING_' . $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy) . ');';
89
+            $lines[] = '$metadata->setChangeTrackingPolicy(ClassMetadata::CHANGETRACKING_'.$this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy).');';
90 90
         }
91 91
 
92 92
         if ($metadata->lifecycleCallbacks) {
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         }
108 108
 
109 109
         if ( ! $metadata->isIdentifierComposite && $generatorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) {
110
-            $lines[] = '$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_' . $generatorType . ');';
110
+            $lines[] = '$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_'.$generatorType.');';
111 111
         }
112 112
 
113 113
         foreach ($metadata->associationMappings as $associationMapping) {
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 
194 194
             $associationMappingArray = array_merge($associationMappingArray, $specificMappingArray);
195 195
 
196
-            $lines[] = '$metadata->' . $method . '(' . $this->_varExport($associationMappingArray) . ');';
196
+            $lines[] = '$metadata->'.$method.'('.$this->_varExport($associationMappingArray).');';
197 197
         }
198 198
 
199 199
         return implode("\n", $lines);
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
     protected function _varExport($var)
208 208
     {
209 209
         $export = var_export($var, true);
210
-        $export = str_replace("\n", PHP_EOL . str_repeat(' ', 8), $export);
210
+        $export = str_replace("\n", PHP_EOL.str_repeat(' ', 8), $export);
211 211
         $export = str_replace('  ', ' ', $export);
212 212
         $export = str_replace('array (', 'array(', $export);
213 213
         $export = str_replace('array( ', 'array(', $export);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
             $columnName     = $this->platform->quoteIdentifier($joinColumn['name']);
133 133
             $referencedName = $joinColumn['referencedColumnName'];
134 134
 
135
-            $conditions[]   = 't.' . $columnName . ' = ?';
135
+            $conditions[]   = 't.'.$columnName.' = ?';
136 136
             $params[]       = $id[$sourceClass->getFieldForColumn($referencedName)];
137 137
             $types[]        = PersisterHelper::getTypeOfColumn($referencedName, $sourceClass, $this->em);
138 138
         }
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
         }*/
162 162
 
163 163
         $sql = 'SELECT COUNT(*)'
164
-            . ' FROM ' . $joinTableName . ' t'
164
+            . ' FROM '.$joinTableName.' t'
165 165
             . $joinTargetEntitySQL
166
-            . ' WHERE ' . implode(' AND ', $conditions);
166
+            . ' WHERE '.implode(' AND ', $conditions);
167 167
 
168 168
         return $this->conn->fetchColumn($sql, $params, 0, $types);
169 169
     }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictionsWithKey($collection, $key, true);
193 193
 
194
-        $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
194
+        $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
195 195
 
196 196
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
197 197
     }
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 
208 208
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true);
209 209
 
210
-        $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
210
+        $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
211 211
 
212 212
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
213 213
     }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 
224 224
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false);
225 225
 
226
-        $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
226
+        $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
227 227
 
228 228
         return (bool) $this->conn->executeUpdate($sql, $params, $types);
229 229
     }
@@ -273,11 +273,11 @@  discard block
 block discarded – undo
273 273
         $rsm = new Query\ResultSetMappingBuilder($this->em);
274 274
         $rsm->addRootEntityFromClassMetadata($targetClass->name, 'te');
275 275
 
276
-        $sql = 'SELECT ' . $rsm->generateSelectClause()
277
-            . ' FROM ' . $tableName . ' te'
278
-            . ' JOIN ' . $joinTable  . ' t ON'
276
+        $sql = 'SELECT '.$rsm->generateSelectClause()
277
+            . ' FROM '.$tableName.' te'
278
+            . ' JOIN '.$joinTable.' t ON'
279 279
             . implode(' AND ', $onConditions)
280
-            . ' WHERE ' . implode(' AND ', $whereClauses);
280
+            . ' WHERE '.implode(' AND ', $whereClauses);
281 281
 
282 282
         $sql .= $this->getOrderingSql($criteria, $targetClass);
283 283
 
@@ -318,8 +318,8 @@  discard block
 block discarded – undo
318 318
 
319 319
         // A join is needed if there is filtering on the target entity
320 320
         $tableName = $this->quoteStrategy->getTableName($rootClass, $this->platform);
321
-        $joinSql   = ' JOIN ' . $tableName . ' te'
322
-            . ' ON' . implode(' AND ', $this->getOnConditionSQL($mapping));
321
+        $joinSql   = ' JOIN '.$tableName.' te'
322
+            . ' ON'.implode(' AND ', $this->getOnConditionSQL($mapping));
323 323
 
324 324
         return array($joinSql, $filterSql);
325 325
     }
@@ -338,12 +338,12 @@  discard block
 block discarded – undo
338 338
 
339 339
         foreach ($this->em->getFilters()->getEnabledFilters() as $filter) {
340 340
             if ($filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) {
341
-                $filterClauses[] = '(' . $filterExpr . ')';
341
+                $filterClauses[] = '('.$filterExpr.')';
342 342
             }
343 343
         }
344 344
 
345 345
         return $filterClauses
346
-            ? '(' . implode(' AND ', $filterClauses) . ')'
346
+            ? '('.implode(' AND ', $filterClauses).')'
347 347
             : '';
348 348
     }
349 349
 
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
             $joinColumnName = $this->platform->quoteIdentifier($joinColumn['name']);
372 372
             $refColumnName  = $this->platform->quoteIdentifier($joinColumn['referencedColumnName']);
373 373
 
374
-            $conditions[] = ' t.' . $joinColumnName . ' = ' . 'te.' . $refColumnName;
374
+            $conditions[] = ' t.'.$joinColumnName.' = '.'te.'.$refColumnName;
375 375
         }
376 376
 
377 377
         return $conditions;
@@ -393,8 +393,8 @@  discard block
 block discarded – undo
393 393
             $columns[] = $this->platform->quoteIdentifier($joinColumn['name']);
394 394
         }
395 395
 
396
-        return 'DELETE FROM ' . $joinTable
397
-            . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?';
396
+        return 'DELETE FROM '.$joinTable
397
+            . ' WHERE '.implode(' = ? AND ', $columns).' = ?';
398 398
     }
399 399
 
400 400
     /**
@@ -451,8 +451,8 @@  discard block
 block discarded – undo
451 451
         }
452 452
 
453 453
         return array(
454
-            'DELETE FROM ' . $this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform)
455
-            . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?',
454
+            'DELETE FROM '.$this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform)
455
+            . ' WHERE '.implode(' = ? AND ', $columns).' = ?',
456 456
             $types,
457 457
         );
458 458
     }
@@ -500,10 +500,10 @@  discard block
 block discarded – undo
500 500
         }
501 501
 
502 502
         return array(
503
-            'INSERT INTO ' . $this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform)
504
-            . ' (' . implode(', ', $columns) . ')'
503
+            'INSERT INTO '.$this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform)
504
+            . ' ('.implode(', ', $columns).')'
505 505
             . ' VALUES'
506
-            . ' (' . implode(', ', array_fill(0, count($columns), '?')) . ')',
506
+            . ' ('.implode(', ', array_fill(0, count($columns), '?')).')',
507 507
             $types,
508 508
         );
509 509
     }
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
         $sourceClass   = $this->em->getClassMetadata($mapping['sourceEntity']);
589 589
         $targetClass   = $this->em->getClassMetadata($mapping['targetEntity']);
590 590
 
591
-        if (! $mapping['isOwningSide']) {
591
+        if ( ! $mapping['isOwningSide']) {
592 592
             $associationSourceClass = $this->em->getClassMetadata($mapping['targetEntity']);
593 593
             $mapping                = $associationSourceClass->associationMappings[$mapping['mappedBy']];
594 594
             $joinColumns            = $mapping['joinTable']['joinColumns'];
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
             $targetRelationMode     = 'relationToTargetKeyColumns';
602 602
         }
603 603
 
604
-        $quotedJoinTable = $this->quoteStrategy->getJoinTableName($mapping, $associationSourceClass, $this->platform). ' t';
604
+        $quotedJoinTable = $this->quoteStrategy->getJoinTableName($mapping, $associationSourceClass, $this->platform).' t';
605 605
         $whereClauses    = array();
606 606
         $params          = array();
607 607
         $types           = array();
@@ -612,14 +612,14 @@  discard block
 block discarded – undo
612 612
             $joinConditions = array();
613 613
 
614 614
             foreach ($joinColumns as $joinTableColumn) {
615
-                $joinConditions[] = 't.' . $joinTableColumn['name'] . ' = tr.' . $joinTableColumn['referencedColumnName'];
615
+                $joinConditions[] = 't.'.$joinTableColumn['name'].' = tr.'.$joinTableColumn['referencedColumnName'];
616 616
             }
617 617
 
618 618
             $tableName        = $this->quoteStrategy->getTableName($targetClass, $this->platform);
619
-            $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions);
619
+            $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions);
620 620
             $columnName       = $targetClass->getColumnName($indexBy);
621 621
 
622
-            $whereClauses[] = 'tr.' . $columnName . ' = ?';
622
+            $whereClauses[] = 'tr.'.$columnName.' = ?';
623 623
             $params[]       = $key;
624 624
             $types[]        = PersisterHelper::getTypeOfColumn($columnName, $targetClass, $this->em);
625 625
         }
@@ -627,13 +627,13 @@  discard block
 block discarded – undo
627 627
         foreach ($mapping['joinTableColumns'] as $joinTableColumn) {
628 628
             if (isset($mapping[$sourceRelationMode][$joinTableColumn])) {
629 629
                 $column         = $mapping[$sourceRelationMode][$joinTableColumn];
630
-                $whereClauses[] = 't.' . $joinTableColumn . ' = ?';
630
+                $whereClauses[] = 't.'.$joinTableColumn.' = ?';
631 631
                 $params[]       = $id[$sourceClass->getFieldForColumn($column)];
632 632
                 $types[]        = PersisterHelper::getTypeOfColumn($column, $sourceClass, $this->em);
633 633
             } elseif ( ! $joinNeeded) {
634 634
                 $column = $mapping[$targetRelationMode][$joinTableColumn];
635 635
 
636
-                $whereClauses[] = 't.' . $joinTableColumn . ' = ?';
636
+                $whereClauses[] = 't.'.$joinTableColumn.' = ?';
637 637
                 $params[]       = $key;
638 638
                 $types[]        = PersisterHelper::getTypeOfColumn($column, $targetClass, $this->em);
639 639
             }
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
             list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($filterMapping);
644 644
 
645 645
             if ($filterSql) {
646
-                $quotedJoinTable .= ' ' . $joinTargetEntitySQL;
646
+                $quotedJoinTable .= ' '.$joinTargetEntitySQL;
647 647
                 $whereClauses[] = $filterSql;
648 648
             }
649 649
         }
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
         $types           = array();
688 688
 
689 689
         foreach ($mapping['joinTableColumns'] as $joinTableColumn) {
690
-            $whereClauses[] = ($addFilters ? 't.' : '') . $joinTableColumn . ' = ?';
690
+            $whereClauses[] = ($addFilters ? 't.' : '').$joinTableColumn.' = ?';
691 691
 
692 692
             if (isset($mapping['relationToTargetKeyColumns'][$joinTableColumn])) {
693 693
                 $targetColumn = $mapping['relationToTargetKeyColumns'][$joinTableColumn];
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
             list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($filterMapping);
710 710
 
711 711
             if ($filterSql) {
712
-                $quotedJoinTable .= ' ' . $joinTargetEntitySQL;
712
+                $quotedJoinTable .= ' '.$joinTargetEntitySQL;
713 713
                 $whereClauses[] = $filterSql;
714 714
             }
715 715
         }
@@ -758,10 +758,10 @@  discard block
 block discarded – undo
758 758
                 $property   = $targetClass->getProperty($name);
759 759
                 $columnName = $this->platform->quoteIdentifier($property->getColumnName());
760 760
                 
761
-                $orderBy[] = $columnName . ' ' . $direction;
761
+                $orderBy[] = $columnName.' '.$direction;
762 762
             }
763 763
 
764
-            return ' ORDER BY ' . implode(', ', $orderBy);
764
+            return ' ORDER BY '.implode(', ', $orderBy);
765 765
         }
766 766
         return '';
767 767
     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
                 }
179 179
 
180 180
                 foreach ($data as $columnName => $value) {
181
-                    if (!is_array($id) || !isset($id[$columnName])) {
181
+                    if ( ! is_array($id) || ! isset($id[$columnName])) {
182 182
                         $type = $this->columns[$columnName] instanceof ColumnMetadata
183 183
                             ? $this->columns[$columnName]->getType()
184 184
                             : $this->columns[$columnName]['type']
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 
300 300
         if ($filterSql = $this->generateFilterConditionSQL($rootClass, $tableAlias)) {
301 301
             $conditionSql .= $conditionSql
302
-                ? ' AND ' . $filterSql
302
+                ? ' AND '.$filterSql
303 303
                 : $filterSql;
304 304
         }
305 305
 
@@ -318,29 +318,29 @@  discard block
 block discarded – undo
318 318
         switch ($lockMode) {
319 319
             case LockMode::PESSIMISTIC_READ:
320 320
 
321
-                $lockSql = ' ' . $this->platform->getReadLockSql();
321
+                $lockSql = ' '.$this->platform->getReadLockSql();
322 322
 
323 323
                 break;
324 324
 
325 325
             case LockMode::PESSIMISTIC_WRITE:
326 326
 
327
-                $lockSql = ' ' . $this->platform->getWriteLockSql();
327
+                $lockSql = ' '.$this->platform->getWriteLockSql();
328 328
 
329 329
                 break;
330 330
         }
331 331
 
332 332
         $tableName  = $this->quoteStrategy->getTableName($this->class, $this->platform);
333
-        $from       = ' FROM ' . $tableName . ' ' . $baseTableAlias;
334
-        $where      = $conditionSql != '' ? ' WHERE ' . $conditionSql : '';
333
+        $from       = ' FROM '.$tableName.' '.$baseTableAlias;
334
+        $where      = $conditionSql != '' ? ' WHERE '.$conditionSql : '';
335 335
         $lock       = $this->platform->appendLockHint($from, $lockMode);
336 336
         $columnList = $this->getSelectColumnsSQL();
337
-        $query      = 'SELECT '  . $columnList
337
+        $query      = 'SELECT '.$columnList
338 338
                     . $lock
339 339
                     . $joinSql
340 340
                     . $where
341 341
                     . $orderBySql;
342 342
 
343
-        return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql;
343
+        return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql;
344 344
     }
345 345
 
346 346
     /**
@@ -362,14 +362,14 @@  discard block
 block discarded – undo
362 362
 
363 363
         if ('' !== $filterSql) {
364 364
             $conditionSql = $conditionSql
365
-                ? $conditionSql . ' AND ' . $filterSql
365
+                ? $conditionSql.' AND '.$filterSql
366 366
                 : $filterSql;
367 367
         }
368 368
 
369 369
         $sql = 'SELECT COUNT(*) '
370
-            . 'FROM ' . $tableName . ' ' . $baseTableAlias
370
+            . 'FROM '.$tableName.' '.$baseTableAlias
371 371
             . $joinSql
372
-            . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql);
372
+            . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql);
373 373
 
374 374
         return $sql;
375 375
     }
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
             $conditions   = array();
389 389
             $parentClass  = $this->em->getClassMetadata($parentClassName);
390 390
             $tableAlias   = $this->getSQLTableAlias($parentClass->getTableName());
391
-            $joinSql     .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON ';
391
+            $joinSql     .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON ';
392 392
 
393 393
             foreach ($identifierColumns as $idColumn) {
394 394
                 $quotedColumnName = $idColumn instanceof ColumnMetadata
@@ -396,13 +396,13 @@  discard block
 block discarded – undo
396 396
                     : $this->platform->quoteIdentifier($idColumn['name'])
397 397
                 ;
398 398
 
399
-                $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
399
+                $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
400 400
             }
401 401
 
402 402
             $joinSql .= implode(' AND ', $conditions);
403 403
         }
404 404
 
405
-        return parent::getLockTablesSql($lockMode) . $joinSql;
405
+        return parent::getLockTablesSql($lockMode).$joinSql;
406 406
     }
407 407
 
408 408
     /**
@@ -451,13 +451,13 @@  discard block
 block discarded – undo
451 451
         $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType);
452 452
 
453 453
         $columnList[] = $discrColumnType->convertToDatabaseValueSQL(
454
-            $this->getSQLTableAlias($discrColumn->getTableName()) . '.' . $discrColumnName,
454
+            $this->getSQLTableAlias($discrColumn->getTableName()).'.'.$discrColumnName,
455 455
             $this->platform
456 456
         );
457 457
 
458 458
         // sub tables
459 459
         foreach ($this->class->subClasses as $subClassName) {
460
-            $subClass   = $this->em->getClassMetadata($subClassName);
460
+            $subClass = $this->em->getClassMetadata($subClassName);
461 461
 
462 462
             // Add subclass columns
463 463
             foreach ($subClass->getProperties() as $fieldName => $property) {
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
             $conditions   = array();
582 582
             $parentClass  = $this->em->getClassMetadata($parentClassName);
583 583
             $tableAlias   = $this->getSQLTableAlias($parentClass->getTableName());
584
-            $joinSql     .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON ';
584
+            $joinSql     .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON ';
585 585
 
586 586
             foreach ($identifierColumns as $idColumn) {
587 587
                 $quotedColumnName = $idColumn instanceof ColumnMetadata
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
                     : $this->platform->quoteIdentifier($idColumn['name'])
590 590
                 ;
591 591
 
592
-                $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
592
+                $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
593 593
             }
594 594
 
595 595
             $joinSql .= implode(' AND ', $conditions);
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
             $conditions  = array();
601 601
             $subClass    = $this->em->getClassMetadata($subClassName);
602 602
             $tableAlias  = $this->getSQLTableAlias($subClass->getTableName());
603
-            $joinSql    .= ' LEFT JOIN ' . $this->quoteStrategy->getTableName($subClass, $this->platform) . ' ' . $tableAlias . ' ON ';
603
+            $joinSql    .= ' LEFT JOIN '.$this->quoteStrategy->getTableName($subClass, $this->platform).' '.$tableAlias.' ON ';
604 604
 
605 605
             foreach ($identifierColumns as $idColumn) {
606 606
                 $quotedColumnName = $idColumn instanceof ColumnMetadata
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
                     : $this->platform->quoteIdentifier($idColumn['name'])
609 609
                 ;
610 610
 
611
-                $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
611
+                $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
612 612
             }
613 613
 
614 614
             $joinSql .= implode(' AND ', $conditions);
Please login to merge, or discard this patch.