Completed
Pull Request — master (#7921)
by Guilherme
14:09
created
lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryRegionCommand.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
     protected function configure()
28 28
     {
29 29
         $this->setName('orm:clear-cache:region:query')
30
-             ->setDescription('Clear a second-level cache query region')
31
-             ->addArgument('region-name', InputArgument::OPTIONAL, 'The query region to clear.')
32
-             ->addOption('all', null, InputOption::VALUE_NONE, 'If defined, all query regions will be deleted/invalidated.')
33
-             ->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, all cache entries will be flushed.')
34
-             ->setHelp(<<<'EOT'
30
+                ->setDescription('Clear a second-level cache query region')
31
+                ->addArgument('region-name', InputArgument::OPTIONAL, 'The query region to clear.')
32
+                ->addOption('all', null, InputOption::VALUE_NONE, 'If defined, all query regions will be deleted/invalidated.')
33
+                ->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, all cache entries will be flushed.')
34
+                ->setHelp(<<<'EOT'
35 35
 The <info>%command.name%</info> command is meant to clear a second-level cache query region for an associated Entity Manager.
36 36
 It is possible to delete/invalidate all query region, a specific query region or flushes the cache provider.
37 37
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 Finally, be aware that if <info>--flush</info> option is passed,
56 56
 not all cache providers are able to flush entries, because of a limitation of its execution nature.
57 57
 EOT
58
-             );
58
+                );
59 59
     }
60 60
 
61 61
     /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             $name = Cache::DEFAULT_QUERY_REGION_NAME;
76 76
         }
77 77
 
78
-        if (! $cache instanceof Cache) {
78
+        if ( ! $cache instanceof Cache) {
79 79
             throw new InvalidArgumentException('No second-level cache is configured on the given EntityManager.');
80 80
         }
81 81
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             $queryCache  = $cache->getQueryCache($name);
84 84
             $queryRegion = $queryCache->getRegion();
85 85
 
86
-            if (! $queryRegion instanceof DefaultRegion) {
86
+            if ( ! $queryRegion instanceof DefaultRegion) {
87 87
                 throw new InvalidArgumentException(sprintf(
88 88
                     'The option "--flush" expects a "Doctrine\ORM\Cache\Region\DefaultRegion", but got "%s".',
89 89
                     is_object($queryRegion) ? get_class($queryRegion) : gettype($queryRegion)
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
     protected function configure()
31 31
     {
32 32
         $this->setName('orm:clear-cache:query')
33
-             ->setDescription('Clear all query cache of the various cache drivers')
34
-             ->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, cache entries will be flushed instead of deleted/invalidated.')
35
-             ->setHelp(<<<'EOT'
33
+                ->setDescription('Clear all query cache of the various cache drivers')
34
+                ->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, cache entries will be flushed instead of deleted/invalidated.')
35
+                ->setHelp(<<<'EOT'
36 36
 The <info>%command.name%</info> command is meant to clear the query cache of associated Entity Manager.
37 37
 It is possible to invalidate all cache entries at once - called delete -, or flushes the cache provider
38 38
 instance completely.
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 Finally, be aware that if <info>--flush</info> option is passed, not all cache providers are able to flush entries,
50 50
 because of a limitation of its execution nature.
51 51
 EOT
52
-             );
52
+                );
53 53
     }
54 54
 
55 55
     /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $em          = $this->getHelper('em')->getEntityManager();
58 58
         $cacheDriver = $em->getConfiguration()->getQueryCacheImpl();
59 59
 
60
-        if (! $cacheDriver) {
60
+        if ( ! $cacheDriver) {
61 61
             throw new InvalidArgumentException('No Query cache driver is configured on given EntityManager.');
62 62
         }
63 63
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             $message = $result ? 'Successfully flushed cache entries.' : $message;
79 79
         }
80 80
 
81
-        if (! $result) {
81
+        if ( ! $result) {
82 82
             $ui->error($message);
83 83
 
84 84
             return 1;
Please login to merge, or discard this patch.
Doctrine/ORM/Tools/Console/Command/ClearCache/CollectionRegionCommand.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
     protected function configure()
28 28
     {
29 29
         $this->setName('orm:clear-cache:region:collection')
30
-             ->setDescription('Clear a second-level cache collection region')
31
-             ->addArgument('owner-class', InputArgument::OPTIONAL, 'The owner entity name.')
32
-             ->addArgument('association', InputArgument::OPTIONAL, 'The association collection name.')
33
-             ->addArgument('owner-id', InputArgument::OPTIONAL, 'The owner identifier.')
34
-             ->addOption('all', null, InputOption::VALUE_NONE, 'If defined, all entity regions will be deleted/invalidated.')
35
-             ->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, all cache entries will be flushed.')
36
-             ->setHelp(<<<'EOT'
30
+                ->setDescription('Clear a second-level cache collection region')
31
+                ->addArgument('owner-class', InputArgument::OPTIONAL, 'The owner entity name.')
32
+                ->addArgument('association', InputArgument::OPTIONAL, 'The association collection name.')
33
+                ->addArgument('owner-id', InputArgument::OPTIONAL, 'The owner identifier.')
34
+                ->addOption('all', null, InputOption::VALUE_NONE, 'If defined, all entity regions will be deleted/invalidated.')
35
+                ->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, all cache entries will be flushed.')
36
+                ->setHelp(<<<'EOT'
37 37
 The <info>%command.name%</info> command is meant to clear a second-level cache collection regions for an associated Entity Manager.
38 38
 It is possible to delete/invalidate all collection region, a specific collection region or flushes the cache provider.
39 39
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 Finally, be aware that if <info>--flush</info> option is passed,
58 58
 not all cache providers are able to flush entries, because of a limitation of its execution nature.
59 59
 EOT
60
-             );
60
+                );
61 61
     }
62 62
 
63 63
     /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         $ownerId    = $input->getArgument('owner-id');
76 76
         $cache      = $em->getCache();
77 77
 
78
-        if (! $cache instanceof Cache) {
78
+        if ( ! $cache instanceof Cache) {
79 79
             throw new InvalidArgumentException('No second-level cache is configured on the given EntityManager.');
80 80
         }
81 81
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         if ($input->getOption('flush')) {
87 87
             $collectionRegion = $cache->getCollectionCacheRegion($ownerClass, $assoc);
88 88
 
89
-            if (! $collectionRegion instanceof DefaultRegion) {
89
+            if ( ! $collectionRegion instanceof DefaultRegion) {
90 90
                 throw new InvalidArgumentException(sprintf(
91 91
                     'The option "--flush" expects a "Doctrine\ORM\Cache\Region\DefaultRegion", but got "%s".',
92 92
                     is_object($collectionRegion) ? get_class($collectionRegion) : gettype($collectionRegion)
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
     protected function configure()
31 31
     {
32 32
         $this->setName('orm:clear-cache:result')
33
-             ->setDescription('Clear all result cache of the various cache drivers')
34
-             ->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, cache entries will be flushed instead of deleted/invalidated.')
35
-             ->setHelp(<<<'EOT'
33
+                ->setDescription('Clear all result cache of the various cache drivers')
34
+                ->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, cache entries will be flushed instead of deleted/invalidated.')
35
+                ->setHelp(<<<'EOT'
36 36
 The <info>%command.name%</info> command is meant to clear the result cache of associated Entity Manager.
37 37
 It is possible to invalidate all cache entries at once - called delete -, or flushes the cache provider
38 38
 instance completely.
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 Finally, be aware that if <info>--flush</info> option is passed, not all cache providers are able to flush entries,
50 50
 because of a limitation of its execution nature.
51 51
 EOT
52
-             );
52
+                );
53 53
     }
54 54
 
55 55
     /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $em          = $this->getHelper('em')->getEntityManager();
58 58
         $cacheDriver = $em->getConfiguration()->getResultCacheImpl();
59 59
 
60
-        if (! $cacheDriver) {
60
+        if ( ! $cacheDriver) {
61 61
             throw new InvalidArgumentException('No Result cache driver is configured on given EntityManager.');
62 62
         }
63 63
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             $message = $result ? 'Successfully flushed cache entries.' : $message;
80 80
         }
81 81
 
82
-        if (! $result) {
82
+        if ( ! $result) {
83 83
             $ui->error($message);
84 84
 
85 85
             return 1;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/ClearCache/EntityRegionCommand.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
     protected function configure()
28 28
     {
29 29
         $this->setName('orm:clear-cache:region:entity')
30
-             ->setDescription('Clear a second-level cache entity region')
31
-             ->addArgument('entity-class', InputArgument::OPTIONAL, 'The entity name.')
32
-             ->addArgument('entity-id', InputArgument::OPTIONAL, 'The entity identifier.')
33
-             ->addOption('all', null, InputOption::VALUE_NONE, 'If defined, all entity regions will be deleted/invalidated.')
34
-             ->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, all cache entries will be flushed.')
35
-             ->setHelp(<<<'EOT'
30
+                ->setDescription('Clear a second-level cache entity region')
31
+                ->addArgument('entity-class', InputArgument::OPTIONAL, 'The entity name.')
32
+                ->addArgument('entity-id', InputArgument::OPTIONAL, 'The entity identifier.')
33
+                ->addOption('all', null, InputOption::VALUE_NONE, 'If defined, all entity regions will be deleted/invalidated.')
34
+                ->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, all cache entries will be flushed.')
35
+                ->setHelp(<<<'EOT'
36 36
 The <info>%command.name%</info> command is meant to clear a second-level cache entity region for an associated Entity Manager.
37 37
 It is possible to delete/invalidate all entity region, a specific entity region or flushes the cache provider.
38 38
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 Finally, be aware that if <info>--flush</info> option is passed,
57 57
 not all cache providers are able to flush entries, because of a limitation of its execution nature.
58 58
 EOT
59
-             );
59
+                );
60 60
     }
61 61
 
62 62
     /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -73,18 +73,18 @@
 block discarded – undo
73 73
         $entityId    = $input->getArgument('entity-id');
74 74
         $cache       = $em->getCache();
75 75
 
76
-        if (! $cache instanceof Cache) {
76
+        if ( ! $cache instanceof Cache) {
77 77
             throw new InvalidArgumentException('No second-level cache is configured on the given EntityManager.');
78 78
         }
79 79
 
80
-        if (! $entityClass && ! $input->getOption('all')) {
80
+        if ( ! $entityClass && ! $input->getOption('all')) {
81 81
             throw new InvalidArgumentException('Invalid argument "--entity-class"');
82 82
         }
83 83
 
84 84
         if ($input->getOption('flush')) {
85 85
             $entityRegion = $cache->getEntityCacheRegion($entityClass);
86 86
 
87
-            if (! $entityRegion instanceof DefaultRegion) {
87
+            if ( ! $entityRegion instanceof DefaultRegion) {
88 88
                 throw new InvalidArgumentException(sprintf(
89 89
                     'The option "--flush" expects a "Doctrine\ORM\Cache\Region\DefaultRegion", but got "%s".',
90 90
                     is_object($entityRegion) ? get_class($entityRegion) : gettype($entityRegion)
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/GH6699Test.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
     public function testMixedParametersWithZeroNumber() : void
21 21
     {
22 22
         $query = $this->em->createQueryBuilder()
23
-                           ->select('u')
24
-                           ->from(CmsUser::class, 'u')
25
-                           ->andWhere('u.username = :username')
26
-                           ->andWhere('u.id = ?0')
27
-                           ->getQuery();
23
+                            ->select('u')
24
+                            ->from(CmsUser::class, 'u')
25
+                            ->andWhere('u.username = :username')
26
+                            ->andWhere('u.id = ?0')
27
+                            ->getQuery();
28 28
 
29 29
         $query->setParameter('username', 'bar');
30 30
         $query->setParameter(0, 0);
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
     public function testMixedParametersWithZeroNumberOnQueryBuilder() : void
40 40
     {
41 41
         $query = $this->em->createQueryBuilder()
42
-                           ->select('u')
43
-                           ->from(CmsUser::class, 'u')
44
-                           ->andWhere('u.username = :username')
45
-                           ->andWhere('u.id = ?0')
46
-                           ->setParameter('username', 'bar')
47
-                           ->setParameter(0, 0)
48
-                           ->getQuery();
42
+                            ->select('u')
43
+                            ->from(CmsUser::class, 'u')
44
+                            ->andWhere('u.username = :username')
45
+                            ->andWhere('u.id = ?0')
46
+                            ->setParameter('username', 'bar')
47
+                            ->setParameter(0, 0)
48
+                            ->getQuery();
49 49
 
50 50
         $query->execute();
51 51
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -247,7 +247,7 @@
 block discarded – undo
247 247
 
248 248
         // 2) Build insert table records into temporary table
249 249
         $dql   = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames())
250
-               . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner';
250
+                . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner';
251 251
         $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner());
252 252
 
253 253
         $statement  = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL();
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         // the entire collection with a new would trigger this operation.
34 34
         $association = $collection->getMapping();
35 35
 
36
-        if (! $association->isOrphanRemoval()) {
36
+        if ( ! $association->isOrphanRemoval()) {
37 37
             // Handling non-orphan removal should never happen, as @OneToMany
38 38
             // can only be inverse side. For owning side one to many, it is
39 39
             // required to have a join table, which would classify as a ManyToManyPersister.
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     {
66 66
         $association = $collection->getMapping();
67 67
 
68
-        if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
68
+        if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
69 69
             throw new BadMethodCallException('Selecting a collection by index is only supported on indexed collections.');
70 70
         }
71 71
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     {
115 115
         $association = $collection->getMapping();
116 116
 
117
-        if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
117
+        if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
118 118
             throw new BadMethodCallException('Selecting a collection by index is only supported on indexed collections.');
119 119
         }
120 120
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      */
137 137
     public function contains(PersistentCollection $collection, $element)
138 138
     {
139
-        if (! $this->isValidEntityState($element)) {
139
+        if ( ! $this->isValidEntityState($element)) {
140 140
             return false;
141 141
         }
142 142
 
@@ -160,12 +160,12 @@  discard block
 block discarded – undo
160 160
     {
161 161
         $association = $collection->getMapping();
162 162
 
163
-        if (! $association->isOrphanRemoval()) {
163
+        if ( ! $association->isOrphanRemoval()) {
164 164
             // no-op: this is not the owning side, therefore no operations should be applied
165 165
             return false;
166 166
         }
167 167
 
168
-        if (! $this->isValidEntityState($element)) {
168
+        if ( ! $this->isValidEntityState($element)) {
169 169
             return false;
170 170
         }
171 171
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         }
204 204
 
205 205
         $tableName = $targetClass->table->getQuotedQualifiedName($this->platform);
206
-        $statement = 'DELETE FROM ' . $tableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?';
206
+        $statement = 'DELETE FROM '.$tableName.' WHERE '.implode(' = ? AND ', $columns).' = ?';
207 207
 
208 208
         return $this->conn->executeUpdate($statement, $parameters);
209 209
     }
@@ -240,17 +240,17 @@  discard block
 block discarded – undo
240 240
             ];
241 241
         }
242 242
 
243
-        $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable
244
-            . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')';
243
+        $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable
244
+            . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')';
245 245
 
246 246
         $this->conn->executeUpdate($statement);
247 247
 
248 248
         // 2) Build insert table records into temporary table
249
-        $dql   = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames())
250
-               . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner';
249
+        $dql   = ' SELECT t0.'.implode(', t0.', $rootClass->getIdentifierFieldNames())
250
+               . ' FROM '.$targetClass->getClassName().' t0 WHERE t0.'.$association->getMappedBy().' = :owner';
251 251
         $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner());
252 252
 
253
-        $statement  = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL();
253
+        $statement  = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.') '.$query->getSQL();
254 254
         $parameters = array_values($sourcePersister->getIdentifier($collection->getOwner()));
255 255
         $numDeleted = $this->conn->executeUpdate($statement, $parameters);
256 256
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
         // 4) Delete records on each table in the hierarchy
266 266
         $hierarchyClasses = array_merge(
267 267
             array_map(
268
-                function ($className) {
268
+                function($className) {
269 269
                     return $this->em->getClassMetadata($className);
270 270
                 },
271 271
                 array_reverse($targetClass->getSubClasses())
Please login to merge, or discard this patch.
lib/Doctrine/ORM/QueryBuilder.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1344,9 +1344,9 @@  discard block
 block discarded – undo
1344 1344
     private function getDQLForDelete()
1345 1345
     {
1346 1346
         return 'DELETE'
1347
-              . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', '])
1348
-              . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE '])
1349
-              . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']);
1347
+                . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', '])
1348
+                . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE '])
1349
+                . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']);
1350 1350
     }
1351 1351
 
1352 1352
     /**
@@ -1355,10 +1355,10 @@  discard block
 block discarded – undo
1355 1355
     private function getDQLForUpdate()
1356 1356
     {
1357 1357
         return 'UPDATE'
1358
-              . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', '])
1359
-              . $this->getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', '])
1360
-              . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE '])
1361
-              . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']);
1358
+                . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', '])
1359
+                . $this->getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', '])
1360
+                . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE '])
1361
+                . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']);
1362 1362
     }
1363 1363
 
1364 1364
     /**
@@ -1367,8 +1367,8 @@  discard block
 block discarded – undo
1367 1367
     private function getDQLForSelect()
1368 1368
     {
1369 1369
         $dql = 'SELECT'
1370
-             . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '')
1371
-             . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']);
1370
+                . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '')
1371
+                . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']);
1372 1372
 
1373 1373
         $fromParts   = $this->getDQLPart('from');
1374 1374
         $joinParts   = $this->getDQLPart('join');
@@ -1392,10 +1392,10 @@  discard block
 block discarded – undo
1392 1392
         }
1393 1393
 
1394 1394
         $dql .= implode(', ', $fromClauses)
1395
-              . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE '])
1396
-              . $this->getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', '])
1397
-              . $this->getReducedDQLQueryPart('having', ['pre' => ' HAVING '])
1398
-              . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']);
1395
+                . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE '])
1396
+                . $this->getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', '])
1397
+                . $this->getReducedDQLQueryPart('having', ['pre' => ' HAVING '])
1398
+                . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']);
1399 1399
 
1400 1400
         return $dql;
1401 1401
     }
@@ -1415,8 +1415,8 @@  discard block
 block discarded – undo
1415 1415
         }
1416 1416
 
1417 1417
         return ($options['pre'] ?? '')
1418
-             . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart)
1419
-             . ($options['post'] ?? '');
1418
+                . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart)
1419
+                . ($options['post'] ?? '');
1420 1420
     }
1421 1421
 
1422 1422
     /**
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
     {
418 418
         $aliases = $this->getRootAliases();
419 419
 
420
-        if (! isset($aliases[0])) {
420
+        if ( ! isset($aliases[0])) {
421 421
             throw new RuntimeException('No alias was set before invoking getRootAlias().');
422 422
         }
423 423
 
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
     public function getParameter($key)
601 601
     {
602 602
         $filteredParameters = $this->parameters->filter(
603
-            static function (Query\Parameter $parameter) use ($key) : bool {
603
+            static function(Query\Parameter $parameter) use ($key) : bool {
604 604
                 $parameterName = $parameter->getName();
605 605
 
606 606
                 return $key === $parameterName || (string) $key === (string) $parameterName;
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
     {
677 677
         if ($append && ($dqlPartName === 'where' || $dqlPartName === 'having')) {
678 678
             throw new InvalidArgumentException(
679
-                "Using \$append = true does not have an effect with 'where' or 'having' " .
679
+                "Using \$append = true does not have an effect with 'where' or 'having' ".
680 680
                 'parts. See QueryBuilder#andWhere() for an example for correct usage.'
681 681
             );
682 682
         }
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
     {
818 818
         $this->type = self::DELETE;
819 819
 
820
-        if (! $delete) {
820
+        if ( ! $delete) {
821 821
             return $this;
822 822
         }
823 823
 
@@ -844,7 +844,7 @@  discard block
 block discarded – undo
844 844
     {
845 845
         $this->type = self::UPDATE;
846 846
 
847
-        if (! $update) {
847
+        if ( ! $update) {
848 848
             return $this;
849 849
         }
850 850
 
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
     {
900 900
         $rootAliases = $this->getRootAliases();
901 901
 
902
-        if (! in_array($alias, $rootAliases, true)) {
902
+        if ( ! in_array($alias, $rootAliases, true)) {
903 903
             throw new Query\QueryException(
904 904
                 sprintf('Specified root alias %s must be set before invoking indexBy().', $alias)
905 905
             );
@@ -1060,7 +1060,7 @@  discard block
 block discarded – undo
1060 1060
      */
1061 1061
     public function where($predicates)
1062 1062
     {
1063
-        if (! (func_num_args() === 1 && $predicates instanceof Expr\Composite)) {
1063
+        if ( ! (func_num_args() === 1 && $predicates instanceof Expr\Composite)) {
1064 1064
             $predicates = new Expr\Andx(func_get_args());
1065 1065
         }
1066 1066
 
@@ -1179,7 +1179,7 @@  discard block
 block discarded – undo
1179 1179
      */
1180 1180
     public function having($having)
1181 1181
     {
1182
-        if (! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) {
1182
+        if ( ! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) {
1183 1183
             $having = new Expr\Andx(func_get_args());
1184 1184
         }
1185 1185
 
@@ -1277,7 +1277,7 @@  discard block
 block discarded – undo
1277 1277
     public function addCriteria(Criteria $criteria)
1278 1278
     {
1279 1279
         $allAliases = $this->getAllAliases();
1280
-        if (! isset($allAliases[0])) {
1280
+        if ( ! isset($allAliases[0])) {
1281 1281
             throw new Query\QueryException('No aliases are set before invoking addCriteria().');
1282 1282
         }
1283 1283
 
@@ -1295,14 +1295,14 @@  discard block
 block discarded – undo
1295 1295
             foreach ($criteria->getOrderings() as $sort => $order) {
1296 1296
                 $hasValidAlias = false;
1297 1297
                 foreach ($allAliases as $alias) {
1298
-                    if (strpos($sort . '.', $alias . '.') === 0) {
1298
+                    if (strpos($sort.'.', $alias.'.') === 0) {
1299 1299
                         $hasValidAlias = true;
1300 1300
                         break;
1301 1301
                     }
1302 1302
                 }
1303 1303
 
1304
-                if (! $hasValidAlias) {
1305
-                    $sort = $allAliases[0] . '.' . $sort;
1304
+                if ( ! $hasValidAlias) {
1305
+                    $sort = $allAliases[0].'.'.$sort;
1306 1306
                 }
1307 1307
 
1308 1308
                 $this->addOrderBy($sort, $order);
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
     private function getDQLForSelect()
1377 1377
     {
1378 1378
         $dql = 'SELECT'
1379
-             . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '')
1379
+             . ($this->dqlParts['distinct'] === true ? ' DISTINCT' : '')
1380 1380
              . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']);
1381 1381
 
1382 1382
         $fromParts   = $this->getDQLPart('from');
@@ -1384,7 +1384,7 @@  discard block
 block discarded – undo
1384 1384
         $fromClauses = [];
1385 1385
 
1386 1386
         // Loop through all FROM clauses
1387
-        if (! empty($fromParts)) {
1387
+        if ( ! empty($fromParts)) {
1388 1388
             $dql .= ' FROM ';
1389 1389
 
1390 1390
             foreach ($fromParts as $from) {
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
 
1393 1393
                 if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) {
1394 1394
                     foreach ($joinParts[$from->getAlias()] as $join) {
1395
-                        $fromClause .= ' ' . ((string) $join);
1395
+                        $fromClause .= ' '.((string) $join);
1396 1396
                     }
1397 1397
                 }
1398 1398
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3785Test.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
         $this->em->flush();
47 47
 
48 48
         $asset->getAttributes()
49
-              ->removeElement($attribute1);
49
+                ->removeElement($attribute1);
50 50
 
51 51
         $idToBeRemoved = $attribute1->id;
52 52
 
Please login to merge, or discard this patch.