Completed
Pull Request — master (#36)
by Thomas
02:38
created
src/QueryBuilder/QueryBuilder.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -331,14 +331,14 @@
 block discarded – undo
331 331
     public function getQuery()
332 332
     {
333 333
         return 'SELECT '
334
-               . (!empty($this->modifier) ? implode(' ', $this->modifier) . ' ' : '')
335
-               . ($this->columns ? implode(',', $this->columns) : '*')
336
-               . ' FROM ' . $this->tableName . ($this->alias ? ' AS ' . $this->alias : '')
337
-               . (!empty($this->joins) ? ' ' . implode(' ', $this->joins) : '')
338
-               . (!empty($this->where) ? ' WHERE ' . implode(' ', $this->where) : '')
339
-               . (!empty($this->groupBy) ? ' GROUP BY ' . implode(',', $this->groupBy) : '')
340
-               . (!empty($this->orderBy) ? ' ORDER BY ' . implode(',', $this->orderBy) : '')
341
-               . ($this->limit ? ' LIMIT ' . $this->limit . ($this->offset ? ' OFFSET ' . $this->offset : '') : '');
334
+                . (!empty($this->modifier) ? implode(' ', $this->modifier) . ' ' : '')
335
+                . ($this->columns ? implode(',', $this->columns) : '*')
336
+                . ' FROM ' . $this->tableName . ($this->alias ? ' AS ' . $this->alias : '')
337
+                . (!empty($this->joins) ? ' ' . implode(' ', $this->joins) : '')
338
+                . (!empty($this->where) ? ' WHERE ' . implode(' ', $this->where) : '')
339
+                . (!empty($this->groupBy) ? ' GROUP BY ' . implode(',', $this->groupBy) : '')
340
+                . (!empty($this->orderBy) ? ' ORDER BY ' . implode(',', $this->orderBy) : '')
341
+                . ($this->limit ? ' LIMIT ' . $this->limit . ($this->offset ? ' OFFSET ' . $this->offset : '') : '');
342 342
     }
343 343
 
344 344
     /** {@inheritdoc} */
Please login to merge, or discard this patch.
src/Relation/ManyToMany.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         }
141 141
 
142 142
         $statement = 'INSERT INTO ' . $table . ' (' . implode(',', $cols) . ') ' .
143
-                     'VALUES (' . implode('),(', $associations) . ')';
143
+                        'VALUES (' . implode('),(', $associations) . ')';
144 144
         $entityManager->getConnection()->query($statement);
145 145
     }
146 146
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             }
163 163
 
164 164
             $where[] = $entityManager->escapeIdentifier($fkCol) . ' = ' .
165
-                       $entityManager->escapeValue($value);
165
+                        $entityManager->escapeValue($value);
166 166
         }
167 167
 
168 168
         foreach ($entities as $entity) {
@@ -179,13 +179,13 @@  discard block
 block discarded – undo
179 179
                 }
180 180
 
181 181
                 $condition[] = $entityManager->escapeIdentifier($fkCol) . ' = ' .
182
-                               $entityManager->escapeValue($value);
182
+                                $entityManager->escapeValue($value);
183 183
             }
184 184
             $where[] = implode(' AND ', $condition);
185 185
         }
186 186
 
187 187
         $statement = 'DELETE FROM ' . $table . ' WHERE ' . array_shift($where) . ' ' .
188
-                     'AND (' . implode(' OR ', $where) . ')';
188
+                        'AND (' . implode(' OR ', $where) . ')';
189 189
         $entityManager->getConnection()->query($statement);
190 190
     }
191 191
 
Please login to merge, or discard this patch.
src/EntityFetcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -297,7 +297,7 @@
 block discarded – undo
297 297
         $this->columns = ['t0.*'];
298 298
         $this->modifier = ['DISTINCT'];
299 299
 
300
-        return (int)$this->entityManager->getConnection()->query($query)->fetchColumn();
300
+        return (int) $this->entityManager->getConnection()->query($query)->fetchColumn();
301 301
     }
302 302
 
303 303
     /**
Please login to merge, or discard this patch.
src/Entity.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -601,7 +601,7 @@
 block discarded – undo
601 601
         if (!empty($var)) {
602 602
             $col = static::getColumnName($var);
603 603
             return (isset($this->data[$col]) ? $this->data[$col] : null) !==
604
-                   (isset($this->originalData[$col]) ? $this->originalData[$col] : null);
604
+                    (isset($this->originalData[$col]) ? $this->originalData[$col] : null);
605 605
         }
606 606
 
607 607
         ksort($this->data);
Please login to merge, or discard this patch.
src/EntityManager.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -337,7 +337,7 @@
 block discarded – undo
337 337
      *
338 338
      * Without $primaryKey it creates an entityFetcher and returns this.
339 339
      *
340
-     * @param string|Entity $class      The entity class you want to fetch
340
+     * @param string $class      The entity class you want to fetch
341 341
      * @param mixed         $primaryKey The primary key of the entity you want to fetch
342 342
      * @return Entity|EntityFetcher
343 343
      * @throws IncompletePrimaryKey
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,6 @@
 block discarded – undo
7 7
 use ORM\Exceptions\InvalidConfiguration;
8 8
 use ORM\Exceptions\NoConnection;
9 9
 use ORM\Exceptions\NoEntity;
10
-use ORM\Exceptions\NotScalar;
11
-use ORM\Exceptions\UnsupportedDriver;
12 10
 
13 11
 /**
14 12
  * The EntityManager that manages the instances of Entities.
Please login to merge, or discard this patch.
src/Dbal.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
         }
190 190
 
191 191
         $statement = 'UPDATE ' . $this->escapeIdentifier($entity::getTableName()) . ' ' .
192
-                     'SET ' . implode(',', $set) . ' ' .
193
-                     'WHERE ' . implode(' AND ', $where);
192
+                        'SET ' . implode(',', $set) . ' ' .
193
+                        'WHERE ' . implode(' AND ', $where);
194 194
         $this->em->getConnection()->query($statement);
195 195
 
196 196
         return true;
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         }
215 215
 
216 216
         $statement = 'DELETE FROM ' . $this->escapeIdentifier($entity::getTableName()) . ' ' .
217
-                     'WHERE ' . implode(' AND ', $where);
217
+                        'WHERE ' . implode(' AND ', $where);
218 218
         $this->em->getConnection()->query($statement);
219 219
 
220 220
         return true;
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
         }, array_values($data));
240 240
 
241 241
         $statement = 'INSERT INTO ' . $this->escapeIdentifier($entity::getTableName()) . ' ' .
242
-                     '(' . implode(',', $cols) . ') VALUES (' . implode(',', $values) . ')';
242
+                        '(' . implode(',', $cols) . ') VALUES (' . implode(',', $values) . ')';
243 243
 
244 244
         return $statement;
245 245
     }
Please login to merge, or discard this patch.
src/Dbal/Mysql.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,8 +74,7 @@
 block discarded – undo
74 74
         $definition['data_type'] = $this->normalizeType($rawColumn['Type']);
75 75
         $definition['column_name'] = $rawColumn['Field'];
76 76
         $definition['is_nullable'] = $rawColumn['Null'] === 'YES';
77
-        $definition['column_default'] = $rawColumn['Default'] !== null ? $rawColumn['Default'] :
78
-            ($rawColumn['Extra'] === 'auto_increment' ? 'sequence(AUTO_INCREMENT)' : null);
77
+        $definition['column_default'] = $rawColumn['Default'] !== null ? $rawColumn['Default'] : ($rawColumn['Extra'] === 'auto_increment' ? 'sequence(AUTO_INCREMENT)' : null);
79 78
         $definition['character_maximum_length'] = null;
80 79
         $definition['datetime_precision'] = null;
81 80
 
Please login to merge, or discard this patch.
src/Dbal/Sqlite.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
         $rawColumns = $result->fetchAll(\PDO::FETCH_ASSOC);
58 58
 
59 59
         if (count($rawColumns) === 0) {
60
-            throw new Exception('Unknown table '  . $table);
60
+            throw new Exception('Unknown table ' . $table);
61 61
         }
62 62
 
63 63
         $hasMultiplePrimaryKey = $this->hasMultiplePrimaryKey($rawColumns);
Please login to merge, or discard this patch.
src/Dbal/Type/Time.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
      */
23 23
     public function __construct($precision = null)
24 24
     {
25
-        $this->precision = (int)$precision;
25
+        $this->precision = (int) $precision;
26 26
     }
27 27
 
28 28
     public static function factory($columnDefinition)
Please login to merge, or discard this patch.