Passed
Push — dev_2x ( d7ecbe...3e8772 )
by Adrian
01:43
created
src/CodeGenerator/Observer/ComputedPropertyObserver.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
                 $setter = $class->addMethod(Str::methodName($name . ' Attribute', 'set'));
58 58
                 $setter->setVisibility(ClassType::VISIBILITY_PROTECTED);
59 59
                 $setter->addParameter('value')
60
-                       ->setNullable($this->property->getNullable())
61
-                       ->setType($alias);
60
+                        ->setNullable($this->property->getNullable())
61
+                        ->setType($alias);
62 62
                 $setter->setBody($body);
63 63
                 $setter->setComment($this->property->getSetterComment());
64 64
             }
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
                 $setter = $class->addMethod(Str::methodName($name, 'set'));
77 77
                 $setter->setVisibility(ClassType::VISIBILITY_PUBLIC);
78 78
                 $setter->addParameter('value')
79
-                       ->setType($type)
80
-                       ->setNullable($this->property->getNullable());
79
+                        ->setType($type)
80
+                        ->setNullable($this->property->getNullable());
81 81
                 $setter->setBody($body);
82 82
                 $setter->setComment($this->property->getSetterComment());
83 83
             }
Please login to merge, or discard this patch.
src/CodeGenerator/Observer/Relation/OneToManyObserver.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@
 block discarded – undo
104 104
 
105 105
     private function addAggregates(ClassType $class)
106 106
     {
107
-        $mapper        = $this->relation->getMapper();
107
+        $mapper = $this->relation->getMapper();
108 108
         $aggregates = $this->relation->getAggregates();
109 109
 
110 110
         foreach ($aggregates as $name => $aggregate) {
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         $name          = $this->relation->getName();
56 56
         $foreignMapper = $mapper->getOrm()->getMapper($this->relation->getForeignMapper());
57 57
         $type          = $foreignMapper->getEntityNamespace()
58
-                         . '\\' . $foreignMapper->getEntityClass();
58
+                            . '\\' . $foreignMapper->getEntityClass();
59 59
 
60 60
         /** @scrutinizer ignore-deprecated */ $class->getNamespace()->addUse(Collection::class);
61 61
         /** @scrutinizer ignore-deprecated */ $class->getNamespace()->addUse($type, null, $type);
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             $setter = $class->addMethod(Str::methodName($name, 'set'));
67 67
             $setter->setVisibility(ClassType::VISIBILITY_PUBLIC);
68 68
             $setter->addParameter('value')
69
-                   ->setType('Collection');
69
+                    ->setType('Collection');
70 70
             $setter->setBody('$this->set(\'' . $name . '\', $value);');
71 71
 
72 72
             $getter = $class->addMethod(Str::methodName($name, 'get'));
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         $adder    = $class->addMethod(Str::methodName($singular, 'add'));
81 81
         $adder->setVisibility(ClassType::VISIBILITY_PUBLIC);
82 82
         $adder->addParameter($singular)
83
-              ->setType($type);
83
+                ->setType($type);
84 84
         $adder->setBody(sprintf('$this->get(\'%s\')->add($%s);', $name, $singular));
85 85
 
86 86
         $class = $this->addAggregates($class);
Please login to merge, or discard this patch.
src/Collection/Collection.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     protected function ensureHydratedElement($element)
42 42
     {
43
-        if (! $this->hydrator) {
43
+        if (!$this->hydrator) {
44 44
             return $element;
45 45
         }
46 46
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     public function add($element)
79 79
     {
80 80
         $element = $this->ensureHydratedElement($element);
81
-        if (! $this->contains($element)) {
81
+        if (!$this->contains($element)) {
82 82
             $this->change('added', $element);
83 83
 
84 84
             return $this->collection->add($element);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     public function removeElement($element)
103 103
     {
104 104
         $element = $this->ensureHydratedElement($element);
105
-        if (! $this->contains($element)) {
105
+        if (!$this->contains($element)) {
106 106
             return true;
107 107
         }
108 108
         $removed = $this->collection->removeElement($this->findByPk($this->hydrator->getPk($element)));
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 
128 128
     public function pluck($names)
129 129
     {
130
-        return $this->map(function ($item) use ($names) {
131
-            if (! is_array($names)) {
130
+        return $this->map(function($item) use ($names) {
131
+            if (!is_array($names)) {
132 132
                 return $this->hydrator->get($item, $names);
133 133
             }
134 134
 
Please login to merge, or discard this patch.
src/CodeGenerator/Observer/Behaviour/TimestampsObserver.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         $class->addProperty('updatedAtColumn', $this->behaviour->getUpdatedAtColumn())
52 52
               ->setVisibility('protected');
53 53
 
54
-        if (! $class->hasMethod('init')) {
54
+        if (!$class->hasMethod('init')) {
55 55
             $class->addMethod('init')->setVisibility('public')
56 56
                   ->setBody('parent::init();' . PHP_EOL);
57 57
         }
Please login to merge, or discard this patch.
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -47,13 +47,13 @@  discard block
 block discarded – undo
47 47
     public function observeBaseMapperClass(ClassType $class): ClassType
48 48
     {
49 49
         $class->addProperty('createdAtColumn', $this->behaviour->getCreatedAtColumn())
50
-              ->setVisibility('protected');
50
+                ->setVisibility('protected');
51 51
         $class->addProperty('updatedAtColumn', $this->behaviour->getUpdatedAtColumn())
52
-              ->setVisibility('protected');
52
+                ->setVisibility('protected');
53 53
 
54 54
         if (! $class->hasMethod('init')) {
55 55
             $class->addMethod('init')->setVisibility('public')
56
-                  ->setBody('parent::init();' . PHP_EOL);
56
+                    ->setBody('parent::init();' . PHP_EOL);
57 57
         }
58 58
         /** @scrutinizer ignore-deprecated */ $class->getNamespace()->addUse(\Sirius\Orm\Behaviour\Timestamps::class);
59 59
         $method = $class->getMethod('init');
@@ -66,35 +66,35 @@  discard block
 block discarded – undo
66 66
     public function observeBaseQueryClass(ClassType $class): ClassType
67 67
     {
68 68
         $class->addProperty('createdAtColumn', $this->behaviour->getCreatedAtColumn())
69
-              ->setVisibility('protected');
69
+                ->setVisibility('protected');
70 70
         $class->addProperty('updatedAtColumn', $this->behaviour->getUpdatedAtColumn())
71
-              ->setVisibility('protected');
71
+                ->setVisibility('protected');
72 72
 
73 73
         // add methods
74 74
         $class->addMethod('orderByFirstCreated')
75
-              ->setVisibility('public')
76
-              ->setBody('
75
+                ->setVisibility('public')
76
+                ->setBody('
77 77
 $this->orderBy($this->createdAtColumn . \' ASC\');
78 78
 
79 79
 return $this;            
80 80
             ');
81 81
         $class->addMethod('orderByLastCreated')
82
-              ->setVisibility('public')
83
-              ->setBody('
82
+                ->setVisibility('public')
83
+                ->setBody('
84 84
 $this->orderBy($this->createdAtColumn . \' DESC\');
85 85
 
86 86
 return $this;            
87 87
             ');
88 88
         $class->addMethod('orderByFirstUpdated')
89
-              ->setVisibility('public')
90
-              ->setBody('
89
+                ->setVisibility('public')
90
+                ->setBody('
91 91
 $this->orderBy($this->updatedAtColumn . \' ASC\');
92 92
 
93 93
 return $this;            
94 94
             ');
95 95
         $class->addMethod('orderByLastCreated')
96
-              ->setVisibility('public')
97
-              ->setBody('
96
+                ->setVisibility('public')
97
+                ->setBody('
98 98
 $this->orderBy($this->updatedAtColumn . \' DESC\');
99 99
 
100 100
 return $this;            
Please login to merge, or discard this patch.
src/CodeGenerator/Observer/Behaviour/SoftDeleteObserver.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@
 block discarded – undo
121 121
               ->setVisibility('protected');
122 122
 
123 123
         // add guard
124
-        if (! $class->hasMethod('init')) {
124
+        if (!$class->hasMethod('init')) {
125 125
             $class->addMethod('init')
126 126
                   ->setVisibility(ClassType::VISIBILITY_PROTECTED)
127 127
                   ->setBody('parent::init();' . PHP_EOL);
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         /** @scrutinizer ignore-deprecated */ $class->getNamespace()->addUse(\Sirius\Orm\Action\Delete::class, 'DeleteAction');
55 55
         /** @scrutinizer ignore-deprecated */ $class->getNamespace()->addUse(\Sirius\Orm\Action\Update::class, 'UpdateAction');
56 56
         $class->addProperty('deletedAtColumn', $this->behaviour->getDeletedAtColumn())
57
-              ->setVisibility('protected');
57
+                ->setVisibility('protected');
58 58
 
59 59
         //
60 60
         $method = $class->addMethod('newDeleteAction');
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
     public function observeBaseQueryClass(ClassType $class): ClassType
120 120
     {
121 121
         $class->addProperty('deletedAtColumn', $this->behaviour->getDeletedAtColumn())
122
-              ->setVisibility('protected');
122
+                ->setVisibility('protected');
123 123
 
124 124
         // add guard
125 125
         if (! $class->hasMethod('init')) {
126 126
             $class->addMethod('init')
127
-                  ->setVisibility(ClassType::VISIBILITY_PROTECTED)
128
-                  ->setBody('parent::init();' . PHP_EOL);
127
+                    ->setVisibility(ClassType::VISIBILITY_PROTECTED)
128
+                    ->setBody('parent::init();' . PHP_EOL);
129 129
         }
130 130
         $init = $class->getMethod('init');
131 131
         $init->addBody('$this->withoutTrashed();' . PHP_EOL);
Please login to merge, or discard this patch.
src/CastingManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             return false;
71 71
         }
72 72
 
73
-        return ! ! $value;
73
+        return !!$value;
74 74
     }
75 75
 
76 76
     // phpcs:ignore
@@ -103,12 +103,12 @@  discard block
 block discarded – undo
103 103
             return $value;
104 104
         }
105 105
 
106
-        return json_decode((string) $value, true);
106
+        return json_decode((string)$value, true);
107 107
     }
108 108
 
109 109
     public function json($value)
110 110
     {
111
-        if (! $value) {
111
+        if (!$value) {
112 112
             return new \ArrayObject();
113 113
         }
114 114
         if (is_array($value)) {
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     // phpcs:ignore
127 127
     public function json_for_db($value)
128 128
     {
129
-        if (! $value) {
129
+        if (!$value) {
130 130
             return null;
131 131
         }
132 132
         if (is_array($value)) {
Please login to merge, or discard this patch.
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.