Passed
Branch dev_2x (3e8772)
by Adrian
01:42
created
src/Relation/ManyToMany.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $query = $this->foreignMapper->newQuery();
62 62
 
63 63
         $query = $this->joinWithPivotTable($query)
64
-                      ->where($this->options[RelationConfig::PIVOT_NATIVE_COLUMN], $nativePks);
64
+                        ->where($this->options[RelationConfig::PIVOT_NATIVE_COLUMN], $nativePks);
65 65
 
66 66
         $query = $this->applyQueryCallback($query);
67 67
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     {
116 116
         $subselect = $this->foreignMapper->newQuery();
117 117
         $subselect = $query->subSelectForJoinWith($this->foreignMapper)
118
-                           ->as($reference);
118
+                            ->as($reference);
119 119
         #$subselect->resetGuards();
120 120
         #$subselect->setGuards($this->foreignMapper->getConfig()->getGuards());
121 121
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,28 +21,28 @@  discard block
 block discarded – undo
21 21
         parent::applyDefaults();
22 22
 
23 23
         $foreignKey = $this->foreignMapper->getConfig()->getPrimaryKey();
24
-        if (! isset($this->options[RelationConfig::FOREIGN_KEY])) {
24
+        if (!isset($this->options[RelationConfig::FOREIGN_KEY])) {
25 25
             $this->options[RelationConfig::FOREIGN_KEY] = $foreignKey;
26 26
         }
27 27
 
28 28
         $nativeKey = $this->foreignMapper->getConfig()->getPrimaryKey();
29
-        if (! isset($this->options[RelationConfig::NATIVE_KEY])) {
29
+        if (!isset($this->options[RelationConfig::NATIVE_KEY])) {
30 30
             $this->options[RelationConfig::NATIVE_KEY] = $nativeKey;
31 31
         }
32 32
 
33
-        if (! isset($this->options[RelationConfig::PIVOT_TABLE])) {
33
+        if (!isset($this->options[RelationConfig::PIVOT_TABLE])) {
34 34
             $tables = [$this->foreignMapper->getConfig()->getTable(), $this->nativeMapper->getConfig()->getTable()];
35 35
             sort($tables);
36 36
             $this->options[RelationConfig::PIVOT_TABLE] = implode('_', $tables);
37 37
         }
38 38
 
39
-        if (! isset($this->options[RelationConfig::PIVOT_NATIVE_COLUMN])) {
39
+        if (!isset($this->options[RelationConfig::PIVOT_NATIVE_COLUMN])) {
40 40
             $prefix = Inflector::singularize($this->nativeMapper->getConfig()->getTableAlias(true));
41 41
 
42 42
             $this->options[RelationConfig::PIVOT_NATIVE_COLUMN] = $this->getKeyColumn($prefix, $nativeKey);
43 43
         }
44 44
 
45
-        if (! isset($this->options[RelationConfig::PIVOT_FOREIGN_COLUMN])) {
45
+        if (!isset($this->options[RelationConfig::PIVOT_FOREIGN_COLUMN])) {
46 46
             $prefix = Inflector::singularize($this->foreignMapper->getConfig()->getTableAlias(true));
47 47
 
48 48
             $this->options[RelationConfig::PIVOT_FOREIGN_COLUMN] = $this->getKeyColumn($prefix, $foreignKey);
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $pivotTableAlias = $this->getOption(RelationConfig::PIVOT_TABLE_ALIAS);
99 99
         $pivotName       = $pivotTableAlias ?? $pivotTable;
100 100
 
101
-        if (! empty($pivotColumns)) {
101
+        if (!empty($pivotColumns)) {
102 102
             foreach ($pivotColumns as $col => $alias) {
103 103
                 $query->columns("{$pivotName}.{$col} AS {$alias}");
104 104
             }
@@ -194,11 +194,11 @@  discard block
 block discarded – undo
194 194
 
195 195
     protected function addActionOnSave(BaseAction $action)
196 196
     {
197
-        if (! $this->relationWasChanged($action->getEntity())) {
197
+        if (!$this->relationWasChanged($action->getEntity())) {
198 198
             return;
199 199
         }
200 200
 
201
-        if (! $action->includesRelation($this->name)) {
201
+        if (!$action->includesRelation($this->name)) {
202 202
             return;
203 203
         }
204 204
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 
207 207
         /** @var Collection $foreignEntities */
208 208
         $foreignEntities = $this->nativeEntityHydrator->get($action->getEntity(), $this->name);
209
-        if (! $foreignEntities || ! $foreignEntities instanceof Collection || $foreignEntities->isEmpty()) {
209
+        if (!$foreignEntities || !$foreignEntities instanceof Collection || $foreignEntities->isEmpty()) {
210 210
             return;
211 211
         }
212 212
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 
215 215
         // save the entities still in the collection
216 216
         foreach ($foreignEntities as $foreignEntity) {
217
-            if (! empty($foreignEntity->getChanges())) {
217
+            if (!empty($foreignEntity->getChanges())) {
218 218
                 $saveAction = $this->foreignMapper
219 219
                     ->newSaveAction($foreignEntity, [
220 220
                         'relations' => $remainingRelations
Please login to merge, or discard this patch.