Passed
Push — master ( ea0818...92b4a6 )
by Adrian
01:28
created
src/QueryBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
     public static function getInstance()
18 18
     {
19
-        if (! static::$instance) {
19
+        if (!static::$instance) {
20 20
             static::$instance = new static;
21 21
         }
22 22
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     protected function getQueryClass(Mapper $mapper)
34 34
     {
35 35
         $mapperClass = get_class($mapper);
36
-        if (! isset($this->queryClasses[$mapperClass])) {
36
+        if (!isset($this->queryClasses[$mapperClass])) {
37 37
             $queryClass = $mapperClass . 'Query';
38 38
             if (class_exists($queryClass)) {
39 39
                 $this->queryClasses[$mapperClass] = $queryClass;
Please login to merge, or discard this patch.
src/Entity/GenericEntity.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         }
99 99
 
100 100
         $value = $this->castAttribute($attribute, $value);
101
-        if (! isset($this->attributes[$attribute]) || $value != $this->attributes[$attribute]) {
101
+        if (!isset($this->attributes[$attribute]) || $value != $this->attributes[$attribute]) {
102 102
             $this->changed[$attribute] = true;
103 103
             $this->state               = StateEnum::CHANGED;
104 104
         }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
     public function get($attribute)
111 111
     {
112
-        if (! $attribute) {
112
+        if (!$attribute) {
113 113
             return null;
114 114
         }
115 115
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
     public function getPersistenceState()
122 122
     {
123
-        if (! empty($this->changed)) {
123
+        if (!empty($this->changed)) {
124 124
         }
125 125
 
126 126
         return $this->state;
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
         $changes = $this->changed;
151 151
         foreach ($this->attributes as $name => $value) {
152 152
             if (is_object($value) && method_exists($value, 'getChanges')) {
153
-                if (! empty($value->getChanges())) {
153
+                if (!empty($value->getChanges())) {
154 154
                     $changes[$name] = true;
155 155
                 }
156 156
             }
Please login to merge, or discard this patch.
src/Relation/ManyToOne.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
         parent::applyDefaults();
15 15
 
16 16
         $foreignKey = $this->foreignMapper->getPrimaryKey();
17
-        if (! isset($this->options[RelationConfig::FOREIGN_KEY])) {
17
+        if (!isset($this->options[RelationConfig::FOREIGN_KEY])) {
18 18
             $this->options[RelationConfig::FOREIGN_KEY] = $foreignKey;
19 19
         }
20 20
 
21
-        if (! isset($this->options[RelationConfig::NATIVE_KEY])) {
21
+        if (!isset($this->options[RelationConfig::NATIVE_KEY])) {
22 22
             $nativeKey                                 = $this->getKeyColumn($this->name, $foreignKey);
23 23
             $this->options[RelationConfig::NATIVE_KEY] = $nativeKey;
24 24
         }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     protected function addActionOnDelete(BaseAction $action)
91 91
     {
92 92
         // no cascade delete? treat it as a save
93
-        if (! $this->isCascade()) {
93
+        if (!$this->isCascade()) {
94 94
             $this->addActionOnSave($action);
95 95
         } else {
96 96
             $nativeEntity  = $action->getEntity();
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@
 block discarded – undo
29 29
     {
30 30
         $tableRef = $this->foreignMapper->getTableAlias(true);
31 31
         $subselect = $query->subSelectForJoinWith()
32
-                           ->from($this->foreignMapper->getTable())
33
-                           ->columns($this->foreignMapper->getTable() . '.*')
34
-                           ->as($reference);
32
+                            ->from($this->foreignMapper->getTable())
33
+                            ->columns($this->foreignMapper->getTable() . '.*')
34
+                            ->as($reference);
35 35
 
36 36
         $subselect = $this->applyQueryCallback($subselect);
37 37
 
Please login to merge, or discard this patch.
src/Relation/OneToMany.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
     protected function applyDefaults(): void
15 15
     {
16 16
         $nativeKey = $this->nativeMapper->getPrimaryKey();
17
-        if (! isset($this->options[RelationConfig::NATIVE_KEY])) {
17
+        if (!isset($this->options[RelationConfig::NATIVE_KEY])) {
18 18
             $this->options[RelationConfig::NATIVE_KEY] = $nativeKey;
19 19
         }
20 20
 
21
-        if (! isset($this->options[RelationConfig::FOREIGN_KEY])) {
21
+        if (!isset($this->options[RelationConfig::FOREIGN_KEY])) {
22 22
             $prefix                                     = Inflector::singularize($this->nativeMapper->getTable());
23 23
             $this->options[RelationConfig::FOREIGN_KEY] = $this->getKeyColumn($prefix, $nativeKey);
24 24
         }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     public function attachEntities(EntityInterface $nativeEntity, EntityInterface $foreignEntity)
70 70
     {
71 71
         foreach ($this->keyPairs as $nativeCol => $foreignCol) {
72
-            $nativeKeyValue  = $this->nativeMapper->getEntityAttribute($nativeEntity, $nativeCol);
72
+            $nativeKeyValue = $this->nativeMapper->getEntityAttribute($nativeEntity, $nativeCol);
73 73
             $this->foreignMapper->setEntityAttribute($foreignEntity, $foreignCol, $nativeKeyValue);
74 74
         }
75 75
     }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $remainingRelations = $this->getRemainingRelations($action->getOption('relations'));
92 92
 
93 93
         // no cascade delete? treat as save so we can process the changes
94
-        if (! $this->isCascade()) {
94
+        if (!$this->isCascade()) {
95 95
             $this->addActionOnSave($action);
96 96
         } else {
97 97
             // retrieve them again from the DB since the related collection might not have everything
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
         // save the entities still in the collection
125 125
         foreach ($foreignEntities as $foreignEntity) {
126
-            if (! empty($foreignEntity->getChanges())) {
126
+            if (!empty($foreignEntity->getChanges())) {
127 127
                 $saveAction = $this->foreignMapper
128 128
                     ->newSaveAction($foreignEntity, ['relations' => $remainingRelations]);
129 129
                 $saveAction->addColumns($this->getExtraColumnsForAction());
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,9 +47,9 @@
 block discarded – undo
47 47
     {
48 48
         $tableRef = $this->foreignMapper->getTableAlias(true);
49 49
         $subselect = $query->subSelectForJoinWith()
50
-                           ->columns($this->foreignMapper->getTable() . '.*')
51
-                           ->from($this->foreignMapper->getTable())
52
-                           ->as($reference);
50
+                            ->columns($this->foreignMapper->getTable() . '.*')
51
+                            ->from($this->foreignMapper->getTable())
52
+                            ->as($reference);
53 53
 
54 54
         $subselect = $this->applyQueryCallback($subselect);
55 55
 
Please login to merge, or discard this patch.
src/Action/Update.php 2 patches
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.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@
 block discarded – undo
55 55
         if (count($columns) > 0) {
56 56
             $updateSql = new \Sirius\Sql\Update($connection);
57 57
             $updateSql->table($this->mapper->getTable())
58
-                      ->columns($columns)
59
-                      ->whereAll($conditions, false);
58
+                        ->columns($columns)
59
+                        ->whereAll($conditions, false);
60 60
             $updateSql->perform();
61 61
         }
62 62
     }
Please login to merge, or discard this patch.
src/Helpers/QueryHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 {
8 8
     public static function reference($table, $tableAlias)
9 9
     {
10
-        if (! $tableAlias || $table == $tableAlias) {
10
+        if (!$tableAlias || $table == $tableAlias) {
11 11
             return $table;
12 12
         }
13 13
 
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 
17 17
     public static function joinCondition($firsTable, $firstColumns, $secondTable, $secondColumns)
18 18
     {
19
-        $firstColumns = (array) $firstColumns;
20
-        $secondColumns = (array) $secondColumns;
19
+        $firstColumns = (array)$firstColumns;
20
+        $secondColumns = (array)$secondColumns;
21 21
 
22 22
         $parts = [];
23 23
         foreach ($firstColumns as $k => $col) {
Please login to merge, or discard this patch.
src/Query.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
 
85 85
     public function joinWith($name): Query
86 86
     {
87
-        if (! $this->mapper->hasRelation($name)) {
87
+        if (!$this->mapper->hasRelation($name)) {
88 88
             throw new \InvalidArgumentException(
89 89
                 sprintf("Relation %s, not defined for %s", $name, $this->mapper->getTable())
90 90
             );
Please login to merge, or discard this patch.
src/CastingManager.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
     public function bool($value)
68 68
     {
69
-        return ! ! $value;
69
+        return !!$value;
70 70
     }
71 71
 
72 72
     // phpcs:ignore
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
     public function float($value)
84 84
     {
85
-        return $value === null ? null : (float) $value;
85
+        return $value === null ? null : (float)$value;
86 86
     }
87 87
 
88 88
     public function decimal($value, $digits)
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
     public function json($value)
94 94
     {
95
-        if (! $value) {
95
+        if (!$value) {
96 96
             return new \ArrayObject();
97 97
         }
98 98
         if (is_array($value)) {
Please login to merge, or discard this patch.
src/Relation/OneToOne.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     protected function addActionOnDelete(BaseAction $action)
31 31
     {
32 32
         // no cascade delete? treat it as a save
33
-        if (! $this->isCascade()) {
33
+        if (!$this->isCascade()) {
34 34
             $this->addActionOnSave($action);
35 35
         } else {
36 36
             $nativeEntity  = $action->getEntity();
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
     protected function addActionOnSave(BaseAction $action)
50 50
     {
51
-        if (! $this->relationWasChanged($action->getEntity())) {
51
+        if (!$this->relationWasChanged($action->getEntity())) {
52 52
             return;
53 53
         }
54 54
         $foreignEntity = $this->nativeMapper->getEntityAttribute($action->getEntity(), $this->name);
Please login to merge, or discard this patch.