Completed
Push — master ( 02d004...3afc21 )
by Thomas
02:23
created
src/Entity.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
         }
686 686
 
687 687
         $statement = 'INSERT INTO ' . $table . ' (' . implode(',', $cols) . ') ' .
688
-                     'VALUES (' . implode('),(', $associations) . ')';
688
+                        'VALUES (' . implode('),(', $associations) . ')';
689 689
         $this->entityManager->getConnection()->query($statement);
690 690
     }
691 691
 
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
             }
727 727
 
728 728
             $where[] = $this->entityManager->escapeIdentifier($fkCol) . ' = ' .
729
-                       $this->entityManager->escapeValue($value);
729
+                        $this->entityManager->escapeValue($value);
730 730
         }
731 731
 
732 732
         foreach ($entities as $entity) {
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
         }
750 750
 
751 751
         $statement = 'DELETE FROM ' . $table . ' WHERE ' . array_shift($where) . ' ' .
752
-                     'AND (' . implode(' OR ', $where) . ')';
752
+                        'AND (' . implode(' OR ', $where) . ')';
753 753
         $this->entityManager->getConnection()->query($statement);
754 754
     }
755 755
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -8 removed lines patch added patch discarded remove patch
@@ -154,8 +154,7 @@  discard block
 block discarded – undo
154 154
                 $from = $match[3][0] === '-' ? count($words) - substr($match[3], 1) : $match[3];
155 155
                 if (isset($words[$from])) {
156 156
                     return !isset($match[4]) ?
157
-                        $words[$from] :
158
-                        implode('_', array_slice($words, $from));
157
+                        $words[$from] : implode('_', array_slice($words, $from));
159 158
                 }
160 159
                 return '';
161 160
             }, static::getTableNameTemplate());
@@ -677,7 +676,7 @@  discard block
 block discarded – undo
677 676
                 if (empty($associations)) {
678 677
                     $cols[] = $this->entityManager->escapeIdentifier($fkCol);
679 678
                 }
680
-                $value        = $entity->__get($hisVar);
679
+                $value = $entity->__get($hisVar);
681 680
 
682 681
                 if ($value === null) {
683 682
                     throw new IncompletePrimaryKey('Key incomplete to save foreign key');
@@ -723,7 +722,7 @@  discard block
 block discarded – undo
723 722
         $where = [];
724 723
 
725 724
         foreach ($myRelDef[self::OPT_RELATION_REFERENCE] as $myVar => $fkCol) {
726
-            $value             = $this->__get($myVar);
725
+            $value = $this->__get($myVar);
727 726
 
728 727
             if ($value === null) {
729 728
                 throw new IncompletePrimaryKey('Key incomplete to save foreign key');
@@ -740,13 +739,13 @@  discard block
 block discarded – undo
740 739
 
741 740
             $condition = [];
742 741
             foreach ($oppRelDef[self::OPT_RELATION_REFERENCE] as $hisVar => $fkCol) {
743
-                $value        = $entity->__get($hisVar);
742
+                $value = $entity->__get($hisVar);
744 743
 
745 744
                 if ($value === null) {
746 745
                     throw new IncompletePrimaryKey('Key incomplete to save foreign key');
747 746
                 }
748 747
 
749
-                $condition[] = $this->entityManager->escapeIdentifier($fkCol) .' = ' .
748
+                $condition[] = $this->entityManager->escapeIdentifier($fkCol) . ' = ' .
750 749
                         $this->entityManager->escapeValue($value);
751 750
             }
752 751
             $where[] = implode(' AND ', $condition);
@@ -900,8 +899,7 @@  discard block
 block discarded – undo
900 899
         }
901 900
 
902 901
         $reference = !isset($myRelDef[self::OPT_RELATION_TABLE]) ?
903
-            array_flip($oppRelDef[self::OPT_RELATION_REFERENCE]) :
904
-            $myRelDef[self::OPT_RELATION_REFERENCE];
902
+            array_flip($oppRelDef[self::OPT_RELATION_REFERENCE]) : $myRelDef[self::OPT_RELATION_REFERENCE];
905 903
         $foreignKey = $this->getForeignKey($reference);
906 904
 
907 905
         if (!isset($myRelDef[self::OPT_RELATION_TABLE])) {
Please login to merge, or discard this patch.
src/EntityManager.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -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
         $pdo = $this->getConnection();
244 244
 
245 245
         if ($useAutoIncrement && $entity::isAutoIncremented()) {
@@ -306,8 +306,8 @@  discard block
 block discarded – undo
306 306
         }
307 307
 
308 308
         $statement = 'UPDATE ' . $this->escapeIdentifier($entity::getTableName()) . ' ' .
309
-                     'SET ' . implode(',', $set) . ' ' .
310
-                     'WHERE ' . implode(' AND ', $where);
309
+                        'SET ' . implode(',', $set) . ' ' .
310
+                        'WHERE ' . implode(' AND ', $where);
311 311
         $this->getConnection()->query($statement);
312 312
 
313 313
         $this->sync($entity, true);
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
         }
338 338
 
339 339
         $statement = 'DELETE FROM ' . $this->escapeIdentifier($entity::getTableName()) . ' ' .
340
-                     'WHERE ' . implode(' AND ', $where);
340
+                        'WHERE ' . implode(' AND ', $where);
341 341
         $this->getConnection()->query($statement);
342 342
 
343 343
         $entity->setOriginalData([]);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -440,10 +440,10 @@
 block discarded – undo
440 440
                 return $this->getConnection()->quote($value);
441 441
 
442 442
             case 'integer':
443
-                return (string)$value;
443
+                return (string) $value;
444 444
 
445 445
             case 'double':
446
-                return (string)$value;
446
+                return (string) $value;
447 447
 
448 448
             case 'boolean':
449 449
                 $connectionType = $this->getConnection()->getAttribute(\PDO::ATTR_DRIVER_NAME);
Please login to merge, or discard this patch.
src/QueryBuilder/QueryBuilder.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
     protected function createJoin($join, $tableName, $expression, $alias, $args, $empty)
213 213
     {
214 214
         $join = $join . ' ' . $tableName
215
-              . ($alias ? ' AS ' . $alias : '');
215
+                . ($alias ? ' AS ' . $alias : '');
216 216
 
217 217
         if (preg_match('/^[A-Za-z_]+$/', $expression)) {
218 218
             $join .= ' USING (' . $expression . ')';
@@ -325,14 +325,14 @@  discard block
 block discarded – undo
325 325
     public function getQuery()
326 326
     {
327 327
         return 'SELECT '
328
-               . (!empty($this->modifier) ? implode(' ', $this->modifier) . ' ' : '')
329
-               . ($this->columns ? implode(',', $this->columns) : '*')
330
-               . ' FROM ' . $this->tableName . ($this->alias ? ' AS ' . $this->alias : '')
331
-               . (!empty($this->joins) ? ' ' . reset($this->joins) : '')
332
-               . (!empty($this->where) ? ' WHERE ' . implode(' ', $this->where) : '')
333
-               . (!empty($this->groupBy) ? ' GROUP BY ' . implode(',', $this->groupBy) : '')
334
-               . (!empty($this->orderBy) ? ' ORDER BY ' . implode(',', $this->orderBy) : '')
335
-               . ($this->limit ? ' LIMIT ' . $this->limit . ($this->offset ? ' OFFSET ' . $this->offset : '') : '');
328
+                . (!empty($this->modifier) ? implode(' ', $this->modifier) . ' ' : '')
329
+                . ($this->columns ? implode(',', $this->columns) : '*')
330
+                . ' FROM ' . $this->tableName . ($this->alias ? ' AS ' . $this->alias : '')
331
+                . (!empty($this->joins) ? ' ' . reset($this->joins) : '')
332
+                . (!empty($this->where) ? ' WHERE ' . implode(' ', $this->where) : '')
333
+                . (!empty($this->groupBy) ? ' GROUP BY ' . implode(',', $this->groupBy) : '')
334
+                . (!empty($this->orderBy) ? ' ORDER BY ' . implode(',', $this->orderBy) : '')
335
+                . ($this->limit ? ' LIMIT ' . $this->limit . ($this->offset ? ' OFFSET ' . $this->offset : '') : '');
336 336
     }
337 337
 
338 338
     /** {@inheritdoc} */
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
     /** {@inheritdoc} */
309 309
     public function limit($limit)
310 310
     {
311
-        $this->limit = (int)$limit;
311
+        $this->limit = (int) $limit;
312 312
 
313 313
         return $this;
314 314
     }
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
     /** {@inheritdoc} */
317 317
     public function offset($offset)
318 318
     {
319
-        $this->offset = (int)$offset;
319
+        $this->offset = (int) $offset;
320 320
 
321 321
         return $this;
322 322
     }
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
@@ -203,7 +203,7 @@
 block discarded – undo
203 203
             return null;
204 204
         }
205 205
 
206
-        $data      = $result->fetch(\PDO::FETCH_ASSOC);
206
+        $data = $result->fetch(\PDO::FETCH_ASSOC);
207 207
 
208 208
         if (!$data) {
209 209
             return null;
Please login to merge, or discard this patch.