Completed
Push — master ( 69d932...08ade8 )
by Adrian
01:49
created
src/Relation/OneToOne.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     protected function addActionOnDelete(BaseAction $action)
33 33
     {
34 34
         // no cascade delete? treat it as a save
35
-        if (! $this->isCascade()) {
35
+        if (!$this->isCascade()) {
36 36
             $this->addActionOnSave($action);
37 37
         } else {
38 38
             $nativeEntity  = $action->getEntity();
Please login to merge, or discard this patch.
src/Relation/Relation.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
     protected function setOptionIfMissing($name, $value)
63 63
     {
64
-        if (! isset($this->options[$name])) {
64
+        if (!isset($this->options[$name])) {
65 65
             $this->options[$name] = $value;
66 66
         }
67 67
     }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
     public function addActions(BaseAction $action)
132 132
     {
133
-        if (! $this->cascadeIsAllowedForAction($action)) {
133
+        if (!$this->cascadeIsAllowedForAction($action)) {
134 134
             return;
135 135
         }
136 136
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     protected function cascadeIsAllowedForAction(BaseAction $action)
200 200
     {
201 201
         $relations = $action->getOption('relations');
202
-        if (is_array($relations) && ! in_array($this->name, $relations)) {
202
+        if (is_array($relations) && !in_array($this->name, $relations)) {
203 203
             return false;
204 204
         }
205 205
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
      */
218 218
     protected function getRemainingRelations($relations)
219 219
     {
220
-        if (! is_array($relations)) {
220
+        if (!is_array($relations)) {
221 221
             return $relations;
222 222
         }
223 223
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
         if (is_array($guards)) {
234 234
             foreach ($guards as $col => $val) {
235 235
                 // guards that are strings (eg: 'deleted_at is null') can't be used as extra columns
236
-                if (! is_int($col)) {
236
+                if (!is_int($col)) {
237 237
                     $cols[$col] = $val;
238 238
                 }
239 239
             }
Please login to merge, or discard this patch.
src/Action/Update.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@
 block discarded – undo
47 47
         if (count($columns) > 0) {
48 48
             $updateSql = new \Sirius\Sql\Update($connection);
49 49
             $updateSql->table($this->mapper->getTable())
50
-                      ->columns($columns)
51
-                      ->where($this->mapper->getPrimaryKey(), $this->entity->getPk());
50
+                        ->columns($columns)
51
+                        ->where($this->mapper->getPrimaryKey(), $this->entity->getPk());
52 52
             $updateSql->perform();
53 53
         }
54 54
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 
58 58
     public function revert()
59 59
     {
60
-        if (! $this->hasRun) {
60
+        if (!$this->hasRun) {
61 61
             return;
62 62
         }
63 63
         $this->entity->setPersistenceState($this->entityState);
Please login to merge, or discard this patch.
src/Action/Insert.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 
29 29
         $insertSql = new \Sirius\Sql\Insert($connection);
30 30
         $insertSql->into($this->mapper->getTable())
31
-                  ->columns($columns);
31
+                    ->columns($columns);
32 32
         $insertSql->perform();
33 33
         $this->entity->setPk($connection->lastInsertId());
34 34
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 
36 36
     public function revert()
37 37
     {
38
-        if (! $this->hasRun) {
38
+        if (!$this->hasRun) {
39 39
             return;
40 40
         }
41 41
         $this->entity->setPK($this->entityId);
Please login to merge, or discard this patch.
src/Action/BaseAction.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
 
99 99
     protected function addActionsForRelatedEntities()
100 100
     {
101
-        if ($this->getOption('relations') === false || ! $this->mapper) {
101
+        if ($this->getOption('relations') === false || !$this->mapper) {
102 102
             return;
103 103
         }
104 104
 
105 105
         foreach ($this->getMapper()->getRelations() as $name) {
106
-            if (! $this->mapper->hasRelation($name)) {
106
+            if (!$this->mapper->hasRelation($name)) {
107 107
                 continue;
108 108
             }
109 109
             $this->mapper->getRelation($name)->addActions($this);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         /** @var ActionInterface $action */
141 141
         foreach ($executed as $action) {
142 142
             // if called by another action, that action will call `onSuccess`
143
-            if (! $calledByAnotherAction || $action !== $this) {
143
+            if (!$calledByAnotherAction || $action !== $this) {
144 144
                 $action->onSuccess();
145 145
             }
146 146
         }
Please login to merge, or discard this patch.
src/Action/Delete.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 
20 20
         $delete = new \Sirius\Sql\Delete($this->mapper->getWriteConnection());
21 21
         $delete->from($this->mapper->getTable())
22
-               ->where('id', $entityId);
22
+                ->where('id', $entityId);
23 23
         $delete->perform();
24 24
     }
25 25
 
Please login to merge, or discard this patch.
src/Action/SoftDelete.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@
 block discarded – undo
21 21
 
22 22
         $update = new \Sirius\Sql\Update($this->mapper->getWriteConnection());
23 23
         $update->table($this->mapper->getTable())
24
-               ->columns([
25
-                   $this->getOption('deleted_at_column') => $this->now
26
-               ])
27
-               ->where('id', $entityId);
24
+                ->columns([
25
+                    $this->getOption('deleted_at_column') => $this->now
26
+                ])
27
+                ->where('id', $entityId);
28 28
         $update->perform();
29 29
     }
30 30
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
     protected function execute()
14 14
     {
15 15
         $entityId = $this->entity->getPk();
16
-        if (! $entityId) {
16
+        if (!$entityId) {
17 17
             return;
18 18
         }
19 19
 
Please login to merge, or discard this patch.
src/Action/AttachEntities.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
 
84 84
         $insert = new \Sirius\Sql\Insert($conn);
85 85
         $insert->into($throughTable)
86
-               ->columns($insertColumns)
87
-               ->perform();
86
+                ->columns($insertColumns)
87
+                ->perform();
88 88
     }
89 89
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,10 +51,10 @@
 block discarded – undo
51 51
         $conn = $this->relation->getNativeMapper()->getWriteConnection();
52 52
         $throughTable = (string)$this->relation->getOption(RelationConfig::THROUGH_TABLE);
53 53
 
54
-        $throughNativeColumns = (array) $this->relation->getOption(RelationConfig::THROUGH_NATIVE_COLUMN);
55
-        $throughForeignColumns = (array) $this->relation->getOption(RelationConfig::THROUGH_FOREIGN_COLUMN);
56
-        $nativeKey = (array) $this->nativeEntity->getPk();
57
-        $foreignKey = (array) $this->foreignEntity->getPk();
54
+        $throughNativeColumns = (array)$this->relation->getOption(RelationConfig::THROUGH_NATIVE_COLUMN);
55
+        $throughForeignColumns = (array)$this->relation->getOption(RelationConfig::THROUGH_FOREIGN_COLUMN);
56
+        $nativeKey = (array)$this->nativeEntity->getPk();
57
+        $foreignKey = (array)$this->foreignEntity->getPk();
58 58
 
59 59
         $delete = new \Sirius\Sql\Delete($conn);
60 60
         $delete->from($throughTable);
Please login to merge, or discard this patch.
src/ConnectionLocator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
     public static function new(...$args)
11 11
     {
12 12
         if ($args[0] instanceof Connection) {
13
-            return new ConnectionLocator(function () use ($args) {
13
+            return new ConnectionLocator(function() use ($args) {
14 14
                 return $args[0];
15 15
             });
16 16
         }
Please login to merge, or discard this patch.