Failed Conditions
Pull Request — master (#6485)
by Alessandro
12:30
created
lib/Doctrine/ORM/Persisters/PersisterException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     static public function matchingAssocationFieldRequiresObject($class, $associationName)
30 30
     {
31 31
         return new self(sprintf(
32
-            "Cannot match on %s::%s with a non-object value. Matching objects by id is " .
32
+            "Cannot match on %s::%s with a non-object value. Matching objects by id is ".
33 33
             "not compatible with matching on an in-memory collection, which compares objects by reference.",
34 34
             $class, $associationName
35 35
         ));
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -147,9 +147,9 @@
 block discarded – undo
147 147
         return (bool) $persister->count($criteria);
148 148
     }
149 149
 
150
-     /**
151
-     * {@inheritdoc}
152
-     */
150
+        /**
151
+         * {@inheritdoc}
152
+         */
153 153
     public function contains(PersistentCollection $collection, $element)
154 154
     {
155 155
         if ( ! $this->isValidEntityState($element)) {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -217,8 +217,8 @@  discard block
 block discarded – undo
217 217
             $parameters[] = $identifier[$sourceClass->getFieldForColumn($joinColumn['referencedColumnName'])];
218 218
         }
219 219
 
220
-        $statement = 'DELETE FROM ' . $this->quoteStrategy->getTableName($targetClass, $this->platform)
221
-            . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?';
220
+        $statement = 'DELETE FROM '.$this->quoteStrategy->getTableName($targetClass, $this->platform)
221
+            . ' WHERE '.implode(' = ? AND ', $columns).' = ?';
222 222
 
223 223
         return $this->conn->executeUpdate($statement, $parameters);
224 224
     }
@@ -255,18 +255,18 @@  discard block
 block discarded – undo
255 255
             ];
256 256
         }
257 257
 
258
-        $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable
259
-            . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')';
258
+        $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable
259
+            . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')';
260 260
 
261 261
         $this->conn->executeUpdate($statement);
262 262
 
263 263
         // 2) Build insert table records into temporary table
264 264
         $query = $this->em->createQuery(
265
-            ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames())
266
-            . ' FROM ' . $targetClass->name . ' t0 WHERE t0.' . $mapping['mappedBy'] . ' = :owner'
265
+            ' SELECT t0.'.implode(', t0.', $rootClass->getIdentifierFieldNames())
266
+            . ' FROM '.$targetClass->name.' t0 WHERE t0.'.$mapping['mappedBy'].' = :owner'
267 267
         )->setParameter('owner', $collection->getOwner());
268 268
 
269
-        $statement  = 'INSERT INTO ' . $tempTable . ' (' . $idColumnList . ') ' . $query->getSQL();
269
+        $statement  = 'INSERT INTO '.$tempTable.' ('.$idColumnList.') '.$query->getSQL();
270 270
         $parameters = array_values($sourceClass->getIdentifierValues($collection->getOwner()));
271 271
         $numDeleted = $this->conn->executeUpdate($statement, $parameters);
272 272
 
@@ -275,8 +275,8 @@  discard block
 block discarded – undo
275 275
 
276 276
         foreach (array_reverse($classNames) as $className) {
277 277
             $tableName = $this->quoteStrategy->getTableName($this->em->getClassMetadata($className), $this->platform);
278
-            $statement = 'DELETE FROM ' . $tableName . ' WHERE (' . $idColumnList . ')'
279
-                . ' IN (SELECT ' . $idColumnList . ' FROM ' . $tempTable . ')';
278
+            $statement = 'DELETE FROM '.$tableName.' WHERE ('.$idColumnList.')'
279
+                . ' IN (SELECT '.$idColumnList.' FROM '.$tempTable.')';
280 280
 
281 281
             $this->conn->executeUpdate($statement);
282 282
         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/EntityPersister.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -47,17 +47,17 @@
 block discarded – undo
47 47
      * Get all queued inserts.
48 48
      *
49 49
      * @return array
50
-    */
50
+     */
51 51
     public function getInserts();
52 52
 
53
-     /**
54
-     * @TODO - It should not be here.
55
-     * But its necessary since JoinedSubclassPersister#executeInserts invoke the root persister.
56
-     *
57
-     * Gets the INSERT SQL used by the persister to persist a new entity.
58
-     *
59
-     * @return string
60
-     */
53
+        /**
54
+         * @TODO - It should not be here.
55
+         * But its necessary since JoinedSubclassPersister#executeInserts invoke the root persister.
56
+         *
57
+         * Gets the INSERT SQL used by the persister to persist a new entity.
58
+         *
59
+         * @return string
60
+         */
61 61
     public function getInsertSQL();
62 62
 
63 63
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/SingleTablePersister.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
         $rootClass  = $this->em->getClassMetadata($this->class->rootEntityName);
58 58
         $tableAlias = $this->getSQLTableAlias($rootClass->name);
59 59
 
60
-         // Append discriminator column
60
+            // Append discriminator column
61 61
         $discrColumn     = $this->class->discriminatorColumn['name'];
62 62
         $discrColumnType = $this->class->discriminatorColumn['type'];
63 63
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $discrColumn     = $this->class->discriminatorColumn['name'];
62 62
         $discrColumnType = $this->class->discriminatorColumn['type'];
63 63
 
64
-        $columnList[]   = $tableAlias . '.' . $discrColumn;
64
+        $columnList[] = $tableAlias.'.'.$discrColumn;
65 65
 
66 66
         $resultColumnName = $this->platform->getSQLResultCasing($discrColumn);
67 67
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             $conditionSql .= ' AND ';
143 143
         }
144 144
 
145
-        return $conditionSql . $this->getSelectConditionDiscriminatorValueSQL();
145
+        return $conditionSql.$this->getSelectConditionDiscriminatorValueSQL();
146 146
     }
147 147
 
148 148
     /**
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
             $conditionSql .= ' AND ';
157 157
         }
158 158
 
159
-        return $conditionSql . $this->getSelectConditionDiscriminatorValueSQL();
159
+        return $conditionSql.$this->getSelectConditionDiscriminatorValueSQL();
160 160
     }
161 161
 
162 162
     /**
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         $discColumn = $this->class->discriminatorColumn['name'];
181 181
         $tableAlias = $this->getSQLTableAlias($this->class->name);
182 182
 
183
-        return $tableAlias . '.' . $discColumn . ' IN (' . $values . ')';
183
+        return $tableAlias.'.'.$discColumn.' IN ('.$values.')';
184 184
     }
185 185
 
186 186
     /**
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.