Passed
Push — dev_2x ( e191af...fa57a5 )
by Adrian
01:51
created
src/Behaviour/Timestamps.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
             $mapper->getHydrator()->set($action->getEntity(), $this->updateColumn, $now);
46 46
         }
47 47
         if ($action instanceof Update && $this->updateColumn) {
48
-            if (! empty($action->getEntity()->getChanges())) {
48
+            if (!empty($action->getEntity()->getChanges())) {
49 49
                 $action->addColumns([$this->updateColumn => $now]);
50 50
                 $mapper->getHydrator()->set($action->getEntity(), $this->updateColumn, $now);
51 51
             }
Please login to merge, or discard this patch.
src/Entity/Tracker.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     {
64 64
         $this->relations[$name]        = $relation;
65 65
         $this->relationCallback[$name] = $callback;
66
-        if (! empty($nextLoad)) {
66
+        if (!empty($nextLoad)) {
67 67
             $this->relationNextLoad[$name] = $nextLoad;
68 68
         }
69 69
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
     public function getResultsForRelation($name)
77 77
     {
78
-        if (! isset($this->relations[$name])) {
78
+        if (!isset($this->relations[$name])) {
79 79
             return [];
80 80
         }
81 81
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $result = [];
113 113
         foreach ($this->rows as $row) {
114 114
             $value = $this->getColumnsFromRow($row, $columns, $hydrator);
115
-            if ($value && ! in_array($value, $result)) {
115
+            if ($value && !in_array($value, $result)) {
116 116
                 $result[] = $value;
117 117
             }
118 118
         }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
     public function getLazyAggregate(Aggregate $aggregate)
144 144
     {
145 145
         $name = $aggregate->getName();
146
-        if (! isset($this->lazyAggregates[$name])) {
146
+        if (!isset($this->lazyAggregates[$name])) {
147 147
             $this->lazyAggregates[$name] = new LazyAggregate($this, $aggregate);
148 148
         }
149 149
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     public function getLazyRelation(Relation $relation)
154 154
     {
155 155
         $name = $relation->getOption('name');
156
-        if (! isset($this->lazyRelations[$name])) {
156
+        if (!isset($this->lazyRelations[$name])) {
157 157
             $this->lazyRelations[$name] = new LazyRelation($this, $relation);
158 158
         }
159 159
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
         }
190 190
 
191 191
         $queryNextLoad = $this->relationNextLoad[$name] ?? [];
192
-        if ($queryNextLoad && ! empty($queryNextLoad)) {
192
+        if ($queryNextLoad && !empty($queryNextLoad)) {
193 193
             foreach ($queryNextLoad as $next => $callback) {
194 194
                 $query = $query->load([$next => $callback]);
195 195
             }
Please login to merge, or discard this patch.
src/Entity/ClassMethodsEntity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 
44 44
         unset($this->lazyLoaders[$attribute]);
45 45
         $value = $this->castAttribute($attribute, $value);
46
-        if (! isset($this->attributes[$attribute]) || $value != $this->attributes[$attribute]) {
46
+        if (!isset($this->attributes[$attribute]) || $value != $this->attributes[$attribute]) {
47 47
             $this->markChanged($attribute);
48 48
             $this->state = StateEnum::CHANGED;
49 49
         }
Please login to merge, or discard this patch.
src/Entity/GenericEntity.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,9 +63,9 @@
 block discarded – undo
63 63
 
64 64
         unset($this->lazyLoaders[$attribute]);
65 65
         $value = $this->castAttribute($attribute, $value);
66
-        if (! isset($this->attributes[$attribute]) || $value != $this->attributes[$attribute]) {
66
+        if (!isset($this->attributes[$attribute]) || $value != $this->attributes[$attribute]) {
67 67
             $this->markChanged($attribute);
68
-            $this->state               = StateEnum::CHANGED;
68
+            $this->state = StateEnum::CHANGED;
69 69
         }
70 70
         $this->attributes[$attribute] = $value;
71 71
     }
Please login to merge, or discard this patch.
src/Entity/BaseEntityTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
         $changes = $this->changed;
99 99
         foreach ($this->attributes as $name => $value) {
100 100
             if (is_object($value) && method_exists($value, 'getChanges')) {
101
-                if (! empty($value->getChanges())) {
101
+                if (!empty($value->getChanges())) {
102 102
                     $changes[$name] = true;
103 103
                 }
104 104
             }
Please login to merge, or discard this patch.
src/Entity/AbstractHydrator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         return $this->set($entity, $this->getMapperConfig()->getPrimaryKey(), $value);
75 75
     }
76 76
 
77
-    public function hydrateToArray(array $attributes= []): array
77
+    public function hydrateToArray(array $attributes = []): array
78 78
     {
79 79
         $attributes = Arr::renameKeys($attributes, $this->getMapperConfig()->getColumnAttributeMap());
80 80
         if ($this->castingManager) {
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
             $relation = $this->mapper->getRelation($name);
92 92
             if ($relation instanceof ToOneInterface
93 93
                 && isset($attributes[$name])
94
-                && ! is_object($attributes[$name])) {
94
+                && !is_object($attributes[$name])) {
95 95
                 $attributes[$name] = $relation->getForeignMapper()->newEntity($attributes[$name]);
96 96
             } elseif ($relation instanceof ToManyInterface
97
-                      && ! $relation instanceof ToOneInterface) {
97
+                      && !$relation instanceof ToOneInterface) {
98 98
                 /**
99 99
                  * here we need to check against ToOneInterface as well
100 100
                  * because OneToOne relation extends
Please login to merge, or discard this patch.
src/Entity/Patcher.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             return;
61 61
         }
62 62
         $foreignMapper = $this->mapper->getRelation($relationName)
63
-                                      ->getForeignMapper();
63
+                                        ->getForeignMapper();
64 64
         $currentValue  = $this->mapper->getHydrator()->get($entity, $relationName);
65 65
         $this->patchOrCreate($foreignMapper, $currentValue, $attributes);
66 66
         $this->mapper->getHydrator()->set($entity, $relationName, $currentValue);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     private function patchCollection(EntityInterface $entity, string $relationName, $attributes)
70 70
     {
71 71
         $foreignMapper = $this->mapper->getRelation($relationName)
72
-                                      ->getForeignMapper();
72
+                                        ->getForeignMapper();
73 73
         /** @var Collection|null $collection */
74 74
         $collection  = $this->mapper->getHydrator()->get($entity, $relationName);
75 75
         if (!$collection || $collection->isEmpty()) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
         $foreignMapper = $this->mapper->getRelation($relationName)
72 72
                                       ->getForeignMapper();
73 73
         /** @var Collection|null $collection */
74
-        $collection  = $this->mapper->getHydrator()->get($entity, $relationName);
74
+        $collection = $this->mapper->getHydrator()->get($entity, $relationName);
75 75
         if (!$collection || $collection->isEmpty()) {
76 76
             $this->mapper->getHydrator()->set($entity, $relationName, $foreignMapper->newCollection($attributes));
77 77
             return;
Please login to merge, or discard this patch.
src/Action/BaseAction.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
     public function includesRelation($relationName)
118 118
     {
119
-        $relations = (array) $this->getOption('relations');
119
+        $relations = (array)$this->getOption('relations');
120 120
 
121 121
         return $relations === true || in_array($relationName, $relations);
122 122
     }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     protected function addActionsForRelatedEntities()
129 129
     {
130
-        if (! $this->mapper) {
130
+        if (!$this->mapper) {
131 131
             return;
132 132
         }
133 133
 
Please login to merge, or discard this patch.
src/MapperConfig.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     public function getTableAlias($fallbackToTable = false)
132 132
     {
133
-        return (! $this->tableAlias && $fallbackToTable) ? $this->table : $this->tableAlias;
133
+        return (!$this->tableAlias && $fallbackToTable) ? $this->table : $this->tableAlias;
134 134
     }
135 135
 
136 136
     public function getColumns(): array
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
     public function getTableReference()
179 179
     {
180
-        if (! $this->tableReference) {
180
+        if (!$this->tableReference) {
181 181
             $this->tableReference = QueryHelper::reference($this->table, $this->tableAlias);
182 182
         }
183 183
 
Please login to merge, or discard this patch.