Completed
Pull Request — master (#5938)
by Maximilian
16:49 queued 08:43
created
lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
                 }
209 209
 
210 210
                 foreach ($data as $columnName => $value) {
211
-                    if (!is_array($id) || !isset($id[$columnName])) {
211
+                    if ( ! is_array($id) || ! isset($id[$columnName])) {
212 212
                         $stmt->bindValue($paramIndex++, $value, $this->columnTypes[$columnName]);
213 213
                     }
214 214
                 }
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
         // If the current class in the root entity, add the filters
324 324
         if ($filterSql = $this->generateFilterConditionSQL($this->em->getClassMetadata($this->class->rootEntityName), $this->getSQLTableAlias($this->class->rootEntityName))) {
325 325
             $conditionSql .= $conditionSql
326
-                ? ' AND ' . $filterSql
326
+                ? ' AND '.$filterSql
327 327
                 : $filterSql;
328 328
         }
329 329
 
@@ -342,29 +342,29 @@  discard block
 block discarded – undo
342 342
         switch ($lockMode) {
343 343
             case LockMode::PESSIMISTIC_READ:
344 344
 
345
-                $lockSql = ' ' . $this->platform->getReadLockSql();
345
+                $lockSql = ' '.$this->platform->getReadLockSql();
346 346
 
347 347
                 break;
348 348
 
349 349
             case LockMode::PESSIMISTIC_WRITE:
350 350
 
351
-                $lockSql = ' ' . $this->platform->getWriteLockSql();
351
+                $lockSql = ' '.$this->platform->getWriteLockSql();
352 352
 
353 353
                 break;
354 354
         }
355 355
 
356 356
         $tableName  = $this->quoteStrategy->getTableName($this->class, $this->platform);
357
-        $from       = ' FROM ' . $tableName . ' ' . $baseTableAlias;
358
-        $where      = $conditionSql != '' ? ' WHERE ' . $conditionSql : '';
357
+        $from       = ' FROM '.$tableName.' '.$baseTableAlias;
358
+        $where      = $conditionSql != '' ? ' WHERE '.$conditionSql : '';
359 359
         $lock       = $this->platform->appendLockHint($from, $lockMode);
360 360
         $columnList = $this->getSelectColumnsSQL();
361
-        $query      = 'SELECT '  . $columnList
361
+        $query      = 'SELECT '.$columnList
362 362
                     . $lock
363 363
                     . $joinSql
364 364
                     . $where
365 365
                     . $orderBySql;
366 366
 
367
-        return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql;
367
+        return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql;
368 368
     }
369 369
 
370 370
     /**
@@ -384,14 +384,14 @@  discard block
 block discarded – undo
384 384
 
385 385
         if ('' !== $filterSql) {
386 386
             $conditionSql = $conditionSql
387
-                ? $conditionSql . ' AND ' . $filterSql
387
+                ? $conditionSql.' AND '.$filterSql
388 388
                 : $filterSql;
389 389
         }
390 390
 
391 391
         $sql = 'SELECT COUNT(*) '
392
-            . 'FROM ' . $tableName . ' ' . $baseTableAlias
392
+            . 'FROM '.$tableName.' '.$baseTableAlias
393 393
             . $joinSql
394
-            . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql);
394
+            . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql);
395 395
 
396 396
         return $sql;
397 397
     }
@@ -410,16 +410,16 @@  discard block
 block discarded – undo
410 410
             $conditions     = array();
411 411
             $tableAlias     = $this->getSQLTableAlias($parentClassName);
412 412
             $parentClass    = $this->em->getClassMetadata($parentClassName);
413
-            $joinSql       .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON ';
413
+            $joinSql       .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON ';
414 414
 
415 415
             foreach ($identifierColumns as $idColumn) {
416
-                $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn;
416
+                $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn;
417 417
             }
418 418
 
419 419
             $joinSql .= implode(' AND ', $conditions);
420 420
         }
421 421
 
422
-        return parent::getLockTablesSql($lockMode) . $joinSql;
422
+        return parent::getLockTablesSql($lockMode).$joinSql;
423 423
     }
424 424
 
425 425
     /**
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
             ? $baseTableAlias
489 489
             : $this->getSQLTableAlias($this->class->rootEntityName);
490 490
 
491
-        $columnList[] = $tableAlias . '.' . $discrColumn;
491
+        $columnList[] = $tableAlias.'.'.$discrColumn;
492 492
 
493 493
         // sub tables
494 494
         foreach ($this->class->subClasses as $subClassName) {
@@ -603,11 +603,11 @@  discard block
 block discarded – undo
603 603
             $conditions   = array();
604 604
             $parentClass  = $this->em->getClassMetadata($parentClassName);
605 605
             $tableAlias   = $this->getSQLTableAlias($parentClassName);
606
-            $joinSql     .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON ';
606
+            $joinSql     .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON ';
607 607
 
608 608
 
609 609
             foreach ($identifierColumn as $idColumn) {
610
-                $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn;
610
+                $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn;
611 611
             }
612 612
 
613 613
             $joinSql .= implode(' AND ', $conditions);
@@ -618,10 +618,10 @@  discard block
 block discarded – undo
618 618
             $conditions  = array();
619 619
             $subClass    = $this->em->getClassMetadata($subClassName);
620 620
             $tableAlias  = $this->getSQLTableAlias($subClassName);
621
-            $joinSql    .= ' LEFT JOIN ' . $this->quoteStrategy->getTableName($subClass, $this->platform) . ' ' . $tableAlias . ' ON ';
621
+            $joinSql    .= ' LEFT JOIN '.$this->quoteStrategy->getTableName($subClass, $this->platform).' '.$tableAlias.' ON ';
622 622
 
623 623
             foreach ($identifierColumn as $idColumn) {
624
-                $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn;
624
+                $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn;
625 625
             }
626 626
 
627 627
             $joinSql .= implode(' AND ', $conditions);
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,12 +3,10 @@
 block discarded – undo
3 3
 namespace Doctrine\Tests\ORM\Cache\Persister\Entity;
4 4
 
5 5
 use Doctrine\Tests\OrmTestCase;
6
-
7 6
 use Doctrine\ORM\Cache\Region;
8 7
 use Doctrine\ORM\EntityManager;
9 8
 use Doctrine\ORM\Mapping\ClassMetadata;
10 9
 use Doctrine\ORM\Persisters\Entity\EntityPersister;
11
-
12 10
 use Doctrine\Tests\Models\Cache\Country;
13 11
 use Doctrine\Common\Collections\Criteria;
14 12
 use Doctrine\Common\Collections\ArrayCollection;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Configuration.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@
 block discarded – undo
151 151
      */
152 152
     public function newDefaultAnnotationDriver($paths = array(), $useSimpleAnnotationReader = true)
153 153
     {
154
-        AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');
154
+        AnnotationRegistry::registerFile(__DIR__.'/Mapping/Driver/DoctrineAnnotations.php');
155 155
 
156 156
         if ($useSimpleAnnotationReader) {
157 157
             // Register the ORM Annotations in the AnnotationRegistry
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -918,7 +918,7 @@
 block discarded – undo
918 918
      * @since 2.5
919 919
      *
920 920
      * @param string $name  The name of the hint.
921
-     * @param mixed  $value The value of the hint.
921
+     * @param string  $value The value of the hint.
922 922
      */
923 923
     public function setDefaultQueryHint($name, $value)
924 924
     {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/EntityRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@
 block discarded – undo
231 231
         }
232 232
 
233 233
         if (empty($arguments)) {
234
-            throw ORMException::findByRequiresParameter($method . $by);
234
+            throw ORMException::findByRequiresParameter($method.$by);
235 235
         }
236 236
 
237 237
         $fieldName = lcfirst(\Doctrine\Common\Util\Inflector::classify($by));
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/AST/ASTException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,6 +33,6 @@
 block discarded – undo
33 33
      */
34 34
     public static function noDispatchForNode($node)
35 35
     {
36
-        return new self("Double-dispatch for node " . get_class($node) . " is not supported.");
36
+        return new self("Double-dispatch for node ".get_class($node)." is not supported.");
37 37
     }
38 38
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/AST/Node.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             foreach ($props as $name => $prop) {
75 75
                 $ident += 4;
76 76
                 $str .= str_repeat(' ', $ident) . '"' . $name . '": '
77
-                      . $this->dump($prop) . ',' . PHP_EOL;
77
+                        . $this->dump($prop) . ',' . PHP_EOL;
78 78
                 $ident -= 4;
79 79
             }
80 80
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
             foreach ($obj as $k => $v) {
88 88
                 $str .= PHP_EOL . str_repeat(' ', $ident) . '"'
89
-                      . $k . '" => ' . $this->dump($v) . ',';
89
+                        . $k . '" => ' . $this->dump($v) . ',';
90 90
                 $some = true;
91 91
             }
92 92
 
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -68,32 +68,32 @@
 block discarded – undo
68 68
         $str = '';
69 69
 
70 70
         if ($obj instanceof Node) {
71
-            $str .= get_class($obj) . '(' . PHP_EOL;
71
+            $str .= get_class($obj).'('.PHP_EOL;
72 72
             $props = get_object_vars($obj);
73 73
 
74 74
             foreach ($props as $name => $prop) {
75 75
                 $ident += 4;
76
-                $str .= str_repeat(' ', $ident) . '"' . $name . '": '
77
-                      . $this->dump($prop) . ',' . PHP_EOL;
76
+                $str .= str_repeat(' ', $ident).'"'.$name.'": '
77
+                      . $this->dump($prop).','.PHP_EOL;
78 78
                 $ident -= 4;
79 79
             }
80 80
 
81
-            $str .= str_repeat(' ', $ident) . ')';
81
+            $str .= str_repeat(' ', $ident).')';
82 82
         } else if (is_array($obj)) {
83 83
             $ident += 4;
84 84
             $str .= 'array(';
85 85
             $some = false;
86 86
 
87 87
             foreach ($obj as $k => $v) {
88
-                $str .= PHP_EOL . str_repeat(' ', $ident) . '"'
89
-                      . $k . '" => ' . $this->dump($v) . ',';
88
+                $str .= PHP_EOL.str_repeat(' ', $ident).'"'
89
+                      . $k.'" => '.$this->dump($v).',';
90 90
                 $some = true;
91 91
             }
92 92
 
93 93
             $ident -= 4;
94
-            $str .= ($some ? PHP_EOL . str_repeat(' ', $ident) : '') . ')';
94
+            $str .= ($some ? PHP_EOL.str_repeat(' ', $ident) : '').')';
95 95
         } else if (is_object($obj)) {
96
-            $str .= 'instanceof(' . get_class($obj) . ')';
96
+            $str .= 'instanceof('.get_class($obj).')';
97 97
         } else {
98 98
             $str .= var_export($obj, true);
99 99
         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/AST/Functions/IdentityFunction.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,9 +86,9 @@
 block discarded – undo
86 86
         $tableName = $sqlWalker->getEntityManager()->getClassMetadata($assoc['sourceEntity'])->getTableName();
87 87
 
88 88
         $tableAlias = $sqlWalker->getSQLTableAlias($tableName, $dqlAlias);
89
-        $columnName  = $quoteStrategy->getJoinColumnName($joinColumn, $targetEntity, $platform);
89
+        $columnName = $quoteStrategy->getJoinColumnName($joinColumn, $targetEntity, $platform);
90 90
 
91
-        return $tableAlias . '.' . $columnName;
91
+        return $tableAlias.'.'.$columnName;
92 92
     }
93 93
 
94 94
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/AST/Functions/SizeFunction.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
                 if ($first) $first = false; else $sql .= ' AND ';
71 71
 
72 72
                 $sql .= $targetTableAlias . '.' . $sourceColumn
73
-                      . ' = '
74
-                      . $sourceTableAlias . '.' . $quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $platform);
73
+                        . ' = '
74
+                        . $sourceTableAlias . '.' . $quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $platform);
75 75
             }
76 76
         } else { // many-to-many
77 77
             $targetClass = $sqlWalker->getEntityManager()->getClassMetadata($assoc['targetEntity']);
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
                 );
101 101
 
102 102
                 $sql .= $joinTableAlias . '.' . $joinColumn['name']
103
-                      . ' = '
104
-                      . $sourceTableAlias . '.' . $sourceColumnName;
103
+                        . ' = '
104
+                        . $sourceTableAlias . '.' . $sourceColumnName;
105 105
             }
106 106
         }
107 107
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             $targetTableAlias   = $sqlWalker->getSQLTableAlias($targetClass->getTableName());
61 61
             $sourceTableAlias   = $sqlWalker->getSQLTableAlias($class->getTableName(), $dqlAlias);
62 62
 
63
-            $sql .= $quoteStrategy->getTableName($targetClass, $platform) . ' ' . $targetTableAlias . ' WHERE ';
63
+            $sql .= $quoteStrategy->getTableName($targetClass, $platform).' '.$targetTableAlias.' WHERE ';
64 64
 
65 65
             $owningAssoc = $targetClass->associationMappings[$assoc['mappedBy']];
66 66
 
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
             foreach ($owningAssoc['targetToSourceKeyColumns'] as $targetColumn => $sourceColumn) {
70 70
                 if ($first) $first = false; else $sql .= ' AND ';
71 71
 
72
-                $sql .= $targetTableAlias . '.' . $sourceColumn
72
+                $sql .= $targetTableAlias.'.'.$sourceColumn
73 73
                       . ' = '
74
-                      . $sourceTableAlias . '.' . $quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $platform);
74
+                      . $sourceTableAlias.'.'.$quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $platform);
75 75
             }
76 76
         } else { // many-to-many
77 77
             $targetClass = $sqlWalker->getEntityManager()->getClassMetadata($assoc['targetEntity']);
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             $sourceTableAlias = $sqlWalker->getSQLTableAlias($class->getTableName(), $dqlAlias);
85 85
 
86 86
             // join to target table
87
-            $sql .= $quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $platform) . ' ' . $joinTableAlias . ' WHERE ';
87
+            $sql .= $quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $platform).' '.$joinTableAlias.' WHERE ';
88 88
 
89 89
             $joinColumns = $assoc['isOwningSide']
90 90
                 ? $joinTable['joinColumns']
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
                     $class->fieldNames[$joinColumn['referencedColumnName']], $class, $platform
100 100
                 );
101 101
 
102
-                $sql .= $joinTableAlias . '.' . $joinColumn['name']
102
+                $sql .= $joinTableAlias.'.'.$joinColumn['name']
103 103
                       . ' = '
104
-                      . $sourceTableAlias . '.' . $sourceColumnName;
104
+                      . $sourceTableAlias.'.'.$sourceColumnName;
105 105
             }
106 106
         }
107 107
 
108
-        return '(' . $sql . ')';
108
+        return '('.$sql.')';
109 109
     }
110 110
 
111 111
     /**
Please login to merge, or discard this patch.
Braces   +10 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,7 +67,11 @@  discard block
 block discarded – undo
67 67
             $first = true;
68 68
 
69 69
             foreach ($owningAssoc['targetToSourceKeyColumns'] as $targetColumn => $sourceColumn) {
70
-                if ($first) $first = false; else $sql .= ' AND ';
70
+                if ($first) {
71
+                    $first = false;
72
+                } else {
73
+                    $sql .= ' AND ';
74
+                }
71 75
 
72 76
                 $sql .= $targetTableAlias . '.' . $sourceColumn
73 77
                       . ' = '
@@ -93,7 +97,11 @@  discard block
 block discarded – undo
93 97
             $first = true;
94 98
 
95 99
             foreach ($joinColumns as $joinColumn) {
96
-                if ($first) $first = false; else $sql .= ' AND ';
100
+                if ($first) {
101
+                    $first = false;
102
+                } else {
103
+                    $sql .= ' AND ';
104
+                }
97 105
 
98 106
                 $sourceColumnName = $quoteStrategy->getColumnName(
99 107
                     $class->fieldNames[$joinColumn['referencedColumnName']], $class, $platform
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,9 +44,9 @@
 block discarded – undo
44 44
      */
45 45
     public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
46 46
     {
47
-        return 'ABS(' . $sqlWalker->walkSimpleArithmeticExpression(
47
+        return 'ABS('.$sqlWalker->walkSimpleArithmeticExpression(
48 48
             $this->simpleArithmeticExpression
49
-        ) . ')';
49
+        ).')';
50 50
     }
51 51
 
52 52
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/AST/Functions/ConcatFunction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
             $args[] = $sqlWalker->walkStringPrimary($expression);
54 54
         }
55 55
 
56
-        return call_user_func_array(array($platform,'getConcatExpression'), $args);
56
+        return call_user_func_array(array($platform, 'getConcatExpression'), $args);
57 57
     }
58 58
 
59 59
     /**
Please login to merge, or discard this patch.