Completed
Pull Request — master (#6442)
by Simone
10:17
created
lib/Doctrine/ORM/Tools/Setup.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public static function registerAutoloadDirectory($directory)
46 46
     {
47
-        if (!class_exists('Doctrine\Common\ClassLoader', false)) {
48
-            require_once $directory . "/Doctrine/Common/ClassLoader.php";
47
+        if ( ! class_exists('Doctrine\Common\ClassLoader', false)) {
48
+            require_once $directory."/Doctrine/Common/ClassLoader.php";
49 49
         }
50 50
 
51 51
         $loader = new ClassLoader("Doctrine", $directory);
52 52
         $loader->register();
53 53
 
54
-        $loader = new ClassLoader("Symfony\Component", $directory . "/Doctrine");
54
+        $loader = new ClassLoader("Symfony\Component", $directory."/Doctrine");
55 55
         $loader->register();
56 56
     }
57 57
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         }
147 147
 
148 148
         if ($cache instanceof CacheProvider) {
149
-            $cache->setNamespace("dc2_" . md5($proxyDir) . "_"); // to avoid collisions
149
+            $cache->setNamespace("dc2_".md5($proxyDir)."_"); // to avoid collisions
150 150
         }
151 151
 
152 152
         $config = new Configuration();
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -209,8 +209,8 @@  discard block
 block discarded – undo
209 209
         $sqlIdentifier = $this->getSQLIdentifier($AST);
210 210
 
211 211
         if ($hasOrderBy) {
212
-            $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlIdentifier);
213
-            $sqlIdentifier[] = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum';
212
+            $orderGroupBy = ' GROUP BY '.implode(', ', $sqlIdentifier);
213
+            $sqlIdentifier[] = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum';
214 214
         }
215 215
 
216 216
         // Build the counter query
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         );
222 222
 
223 223
         if ($hasOrderBy) {
224
-            $sql .= $orderGroupBy . $outerOrderBy;
224
+            $sql .= $orderGroupBy.$outerOrderBy;
225 225
         }
226 226
 
227 227
         // Apply the limit and offset.
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         foreach ($orderByPathExpressions as $pathExpression) {
325 325
             $idVar = $pathExpression->identificationVariable;
326 326
             $field = $pathExpression->field;
327
-            if (!isset($selects[$idVar])) {
327
+            if ( ! isset($selects[$idVar])) {
328 328
                 $selects[$idVar] = [];
329 329
             }
330 330
             $selects[$idVar][$field] = true;
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
         foreach ($AST->selectClause->selectExpressions as $selectExpression) {
336 336
             if ($selectExpression instanceof SelectExpression) {
337 337
                 $idVar = $selectExpression->expression;
338
-                if (!is_string($idVar)) {
338
+                if ( ! is_string($idVar)) {
339 339
                     continue;
340 340
                 }
341 341
                 $field = $selectExpression->fieldIdentificationVariable;
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
     {
369 369
         // If the sql statement has an order by clause, we need to wrap it in a new select distinct
370 370
         // statement
371
-        if (! $orderByClause instanceof OrderByClause) {
371
+        if ( ! $orderByClause instanceof OrderByClause) {
372 372
             return $sql;
373 373
         }
374 374
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
             = [];
405 405
 
406 406
         // Generate DQL alias -> SQL table alias mapping
407
-        foreach(array_keys($this->rsm->aliasMap) as $dqlAlias) {
407
+        foreach (array_keys($this->rsm->aliasMap) as $dqlAlias) {
408 408
             $dqlAliasToClassMap[$dqlAlias] = $class = $this->queryComponents[$dqlAlias]['metadata'];
409 409
             $dqlAliasToSqlTableAliasMap[$dqlAlias] = $this->getSQLTableAlias($class->getTableName(), $dqlAlias);
410 410
         }
@@ -413,13 +413,13 @@  discard block
 block discarded – undo
413 413
         $fieldSearchPattern = '/(?<![a-z0-9_])%s\.%s(?![a-z0-9_])/i';
414 414
 
415 415
         // Generate search patterns for each field's path expression in the order by clause
416
-        foreach($this->rsm->fieldMappings as $fieldAlias => $fieldName) {
416
+        foreach ($this->rsm->fieldMappings as $fieldAlias => $fieldName) {
417 417
             $dqlAliasForFieldAlias = $this->rsm->columnOwnerMap[$fieldAlias];
418 418
             $class = $dqlAliasToClassMap[$dqlAliasForFieldAlias];
419 419
 
420 420
             // If the field is from a joined child table, we won't be ordering
421 421
             // on it.
422
-            if (!isset($class->fieldMappings[$fieldName])) {
422
+            if ( ! isset($class->fieldMappings[$fieldName])) {
423 423
                 continue;
424 424
             }
425 425
 
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
                 // Field was declared in a parent class, so we need to get the proper SQL table alias
439 439
                 // for the joined parent table.
440 440
                 $otherClassMetadata = $this->em->getClassMetadata($fieldMapping['declared']);
441
-                if (!$otherClassMetadata->isMappedSuperclass) {
441
+                if ( ! $otherClassMetadata->isMappedSuperclass) {
442 442
                     $sqlTableAliasForFieldAlias = $this->getSQLTableAlias($otherClassMetadata->getTableName(), $dqlAliasForFieldAlias);
443 443
                 }
444 444
             }
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
             $replacements[] = $fieldAlias;
449 449
         }
450 450
 
451
-        foreach($orderByClause->orderByItems as $orderByItem) {
451
+        foreach ($orderByClause->orderByItems as $orderByItem) {
452 452
             // Walk order by item to get string representation of it
453 453
             $orderByItemString = $this->walkOrderByItem($orderByItem);
454 454
 
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
      */
566 566
     public function walkPathExpression($pathExpr)
567 567
     {
568
-        if (!$this->inSubSelect && !$this->platformSupportsRowNumber() && !in_array($pathExpr, $this->orderByPathExpressions)) {
568
+        if ( ! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions)) {
569 569
             $this->orderByPathExpressions[] = $pathExpr;
570 570
         }
571 571
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
                 
113 113
                 $AST->selectClause->selectExpressions[] = new SelectExpression(
114 114
                     $this->createSelectExpressionItem($item->expression),
115
-                    '_dctrn_ord' . $this->_aliasCounter++
115
+                    '_dctrn_ord'.$this->_aliasCounter++
116 116
                 );
117 117
             }
118 118
         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Pagination/RowNumberOverFunction.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@
 block discarded – undo
43 43
      */
44 44
     public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
45 45
     {
46
-        return 'ROW_NUMBER() OVER(' . trim($sqlWalker->walkOrderByClause(
46
+        return 'ROW_NUMBER() OVER('.trim($sqlWalker->walkOrderByClause(
47 47
             $this->orderByClause
48
-        )) . ')';
48
+        )).')';
49 49
     }
50 50
 
51 51
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                 if ( ! is_dir($dir)) {
142 142
                     mkdir($dir, 0775, true);
143 143
                 }
144
-                if (file_exists($path) && !$this->_overwriteExistingFiles) {
144
+                if (file_exists($path) && ! $this->_overwriteExistingFiles) {
145 145
                     throw ExportException::attemptOverwriteExistingFile($path);
146 146
                 }
147 147
                 file_put_contents($path, $output);
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
      */
160 160
     protected function _generateOutputPath(ClassMetadataInfo $metadata)
161 161
     {
162
-        return $this->_outputDir . '/' . str_replace('\\', '.', $metadata->name) . $this->_extension;
162
+        return $this->_outputDir.'/'.str_replace('\\', '.', $metadata->name).$this->_extension;
163 163
     }
164 164
 
165 165
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
      */
66 66
     protected function _generateOutputPath(ClassMetadataInfo $metadata)
67 67
     {
68
-        return $this->_outputDir . '/' . str_replace('\\', '/', $metadata->name) . $this->_extension;
68
+        return $this->_outputDir.'/'.str_replace('\\', '/', $metadata->name).$this->_extension;
69 69
     }
70 70
 
71 71
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -51,27 +51,27 @@  discard block
 block discarded – undo
51 51
         }
52 52
 
53 53
         if ($metadata->inheritanceType) {
54
-            $lines[] = '$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_' . $this->_getInheritanceTypeString($metadata->inheritanceType) . ');';
54
+            $lines[] = '$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_'.$this->_getInheritanceTypeString($metadata->inheritanceType).');';
55 55
         }
56 56
 
57 57
         if ($metadata->customRepositoryClassName) {
58
-            $lines[] = "\$metadata->customRepositoryClassName = '" . $metadata->customRepositoryClassName . "';";
58
+            $lines[] = "\$metadata->customRepositoryClassName = '".$metadata->customRepositoryClassName."';";
59 59
         }
60 60
 
61 61
         if ($metadata->table) {
62
-            $lines[] = '$metadata->setPrimaryTable(' . $this->_varExport($metadata->table) . ');';
62
+            $lines[] = '$metadata->setPrimaryTable('.$this->_varExport($metadata->table).');';
63 63
         }
64 64
 
65 65
         if ($metadata->discriminatorColumn) {
66
-            $lines[] = '$metadata->setDiscriminatorColumn(' . $this->_varExport($metadata->discriminatorColumn) . ');';
66
+            $lines[] = '$metadata->setDiscriminatorColumn('.$this->_varExport($metadata->discriminatorColumn).');';
67 67
         }
68 68
 
69 69
         if ($metadata->discriminatorMap) {
70
-            $lines[] = '$metadata->setDiscriminatorMap(' . $this->_varExport($metadata->discriminatorMap) . ');';
70
+            $lines[] = '$metadata->setDiscriminatorMap('.$this->_varExport($metadata->discriminatorMap).');';
71 71
         }
72 72
 
73 73
         if ($metadata->changeTrackingPolicy) {
74
-            $lines[] = '$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_' . $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy) . ');';
74
+            $lines[] = '$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_'.$this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy).');';
75 75
         }
76 76
 
77 77
         if ($metadata->lifecycleCallbacks) {
@@ -83,11 +83,11 @@  discard block
 block discarded – undo
83 83
         }
84 84
 
85 85
         foreach ($metadata->fieldMappings as $fieldMapping) {
86
-            $lines[] = '$metadata->mapField(' . $this->_varExport($fieldMapping) . ');';
86
+            $lines[] = '$metadata->mapField('.$this->_varExport($fieldMapping).');';
87 87
         }
88 88
 
89 89
         if ( ! $metadata->isIdentifierComposite && $generatorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) {
90
-            $lines[] = '$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_' . $generatorType . ');';
90
+            $lines[] = '$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_'.$generatorType.');';
91 91
         }
92 92
 
93 93
         foreach ($metadata->associationMappings as $associationMapping) {
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
                 $associationMappingArray = array_merge($associationMappingArray, $manyToManyMappingArray);
151 151
             }
152 152
 
153
-            $lines[] = '$metadata->' . $method . '(' . $this->_varExport($associationMappingArray) . ');';
153
+            $lines[] = '$metadata->'.$method.'('.$this->_varExport($associationMappingArray).');';
154 154
         }
155 155
 
156 156
         return implode("\n", $lines);
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
     protected function _varExport($var)
165 165
     {
166 166
         $export = var_export($var, true);
167
-        $export = str_replace("\n", PHP_EOL . str_repeat(' ', 8), $export);
167
+        $export = str_replace("\n", PHP_EOL.str_repeat(' ', 8), $export);
168 168
         $export = str_replace('  ', ' ', $export);
169 169
         $export = str_replace('array (', 'array(', $export);
170 170
         $export = str_replace('array( ', 'array(', $export);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@
 block discarded – undo
177 177
             $exporter->setMetadata($metadata);
178 178
             $exporter->export();
179 179
 
180
-            $output->writeln(PHP_EOL . sprintf(
180
+            $output->writeln(PHP_EOL.sprintf(
181 181
                 'Exporting "<info>%s</info>" mapping information to "<info>%s</info>"', $toType, $destPath
182 182
             ));
183 183
         } else {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
         }
96 96
 
97 97
         $hydrationModeName = $input->getOption('hydrate');
98
-        $hydrationMode = 'Doctrine\ORM\Query::HYDRATE_' . strtoupper(str_replace('-', '_', $hydrationModeName));
98
+        $hydrationMode = 'Doctrine\ORM\Query::HYDRATE_'.strtoupper(str_replace('-', '_', $hydrationModeName));
99 99
 
100 100
         if ( ! defined($hydrationMode)) {
101 101
             throw new \RuntimeException(
Please login to merge, or discard this patch.