Passed
Pull Request — master (#177)
by
unknown
15:04
created
src/Eloquent/Relations/Graph/Traits/IsRecursiveRelation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
         $keys = $this->getKeys($models, $this->parentKey);
59 59
 
60
-        $constraint = function (Builder $query) use ($models, $whereIn, $column, $keys) {
60
+        $constraint = function(Builder $query) use ($models, $whereIn, $column, $keys) {
61 61
             $query->$whereIn($column, $keys);
62 62
         };
63 63
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     protected function buildDictionary(Collection $results)
82 82
     {
83
-        return $results->mapToDictionary(function (Model $result) {
83
+        return $results->mapToDictionary(function(Model $result) {
84 84
             return [$result->getFirstPathSegment() => $result];
85 85
         })->all();
86 86
     }
Please login to merge, or discard this patch.
src/Eloquent/Relations/Graph/Descendants.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         if (static::$constraints) {
25 25
             $column = $this->andSelf ? $this->getQualifiedParentKeyName() : $this->getQualifiedForeignPivotKeyName();
26 26
 
27
-            $constraint = function (Builder $query) use ($column) {
27
+            $constraint = function(Builder $query) use ($column) {
28 28
                 $query->where(
29 29
                     $column,
30 30
                     '=',
@@ -101,10 +101,10 @@  discard block
 block discarded – undo
101 101
         }
102 102
 
103 103
         $first = $this->andSelf
104
-            ? $query->getQuery()->from . '.' . $this->parentKey
104
+            ? $query->getQuery()->from.'.'.$this->parentKey
105 105
             : $this->getQualifiedForeignPivotKeyName();
106 106
 
107
-        $constraint = function (Builder $query) use ($first) {
107
+        $constraint = function(Builder $query) use ($first) {
108 108
             $query->whereColumn(
109 109
                 $first,
110 110
                 '=',
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
         $table = $this->getRelationCountHash();
134 134
 
135
-        $from = $query->getModel()->getTable() . ' as ' . $table;
135
+        $from = $query->getModel()->getTable().' as '.$table;
136 136
 
137 137
         $query->getModel()->setTable($table);
138 138
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
             ? "$table.$this->parentKey"
141 141
             : "$this->table.$this->foreignPivotKey";
142 142
 
143
-        $constraint = function (Builder $query) use ($first) {
143
+        $constraint = function(Builder $query) use ($first) {
144 144
             $query->whereColumn(
145 145
                 $first,
146 146
                 '=',
Please login to merge, or discard this patch.
src/Query/Grammars/PostgresGrammar.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
      */
108 108
     public function compileCycleDetectionInitialSelect(string $column): string
109 109
     {
110
-        return 'false as ' . $this->wrap($column);
110
+        return 'false as '.$this->wrap($column);
111 111
     }
112 112
 
113 113
     /**
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     public function compileCycleDetectionStopConstraint(string $column): string
132 132
     {
133
-        return 'not ' . $this->wrap($column);
133
+        return 'not '.$this->wrap($column);
134 134
     }
135 135
 
136 136
     /**
Please login to merge, or discard this patch.
src/Query/Grammars/MySqlGrammar.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
      */
19 19
     public function compileInitialPath($column, $alias)
20 20
     {
21
-        return 'cast(' . $this->wrap($column) . ' as char(65535)) as ' . $this->wrap($alias);
21
+        return 'cast('.$this->wrap($column).' as char(65535)) as '.$this->wrap($alias);
22 22
     }
23 23
 
24 24
     /**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     public function selectPathList(Builder $query, $expression, $column, $pathSeparator, $listSeparator)
62 62
     {
63 63
         return $query->selectRaw(
64
-            'group_concat(' . $this->wrap($column) . " separator '$listSeparator')"
64
+            'group_concat('.$this->wrap($column)." separator '$listSeparator')"
65 65
         )->from($expression);
66 66
     }
67 67
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      */
149 149
     public function compileCycleDetectionInitialSelect(string $column): string
150 150
     {
151
-        return 'false as ' . $this->wrap($column);
151
+        return 'false as '.$this->wrap($column);
152 152
     }
153 153
 
154 154
     /**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      */
172 172
     public function compileCycleDetectionStopConstraint(string $column): string
173 173
     {
174
-        return 'not ' . $this->wrap($column);
174
+        return 'not '.$this->wrap($column);
175 175
     }
176 176
 
177 177
     /**
Please login to merge, or discard this patch.
Relations/Traits/Concatenation/IsConcatenableDescendantsRelation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
             );
72 72
         }
73 73
 
74
-        return $results->mapToDictionary(function (Model $result) use ($pathSeparator) {
74
+        return $results->mapToDictionary(function(Model $result) use ($pathSeparator) {
75 75
             $key = strtok($result->laravel_through_key, $pathSeparator);
76 76
 
77 77
             return [$key => $result];
Please login to merge, or discard this patch.
src/Eloquent/Relations/Traits/Concatenation/IsConcatenableRelation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     public function appendToDeepRelationship(array $through, array $foreignKeys, array $localKeys, int $position): array
22 22
     {
23 23
         if ($position === 0) {
24
-            $foreignKeys[] = function (Builder $query, Builder $parentQuery = null) {
24
+            $foreignKeys[] = function(Builder $query, Builder $parentQuery = null) {
25 25
                 if ($parentQuery) {
26 26
                     $this->getRelationExistenceQuery($this->query, $parentQuery);
27 27
                 }
Please login to merge, or discard this patch.
Eloquent/Relations/Traits/Concatenation/IsConcatenableAncestorsRelation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
     {
62 62
         $pathSeparator = $this->related->getPathSeparator();
63 63
 
64
-        return $results->mapToDictionary(function (Model $result) use ($pathSeparator) {
64
+        return $results->mapToDictionary(function(Model $result) use ($pathSeparator) {
65 65
             $key = strtok($result->laravel_through_key, $pathSeparator);
66 66
 
67 67
             return [$key => $result];
Please login to merge, or discard this patch.
src/Eloquent/Relations/Siblings.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         $keys = $this->getKeys($models, $this->localKey);
69 69
 
70 70
         $this->query->where(
71
-            function (Builder $query) use ($keys) {
71
+            function(Builder $query) use ($keys) {
72 72
                 $query->whereIn($this->foreignKey, $keys);
73 73
 
74 74
                 if (in_array(null, $keys, true)) {
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
                 $value = $this->related->newCollection($dictionary[$key]);
98 98
 
99 99
                 if (!$this->andSelf) {
100
-                    $value = $value->reject(function (Model $result) use ($model) {
100
+                    $value = $value->reject(function(Model $result) use ($model) {
101 101
                         return $result->{$result->getLocalKeyName()} == $model->{$model->getLocalKeyName()};
102 102
                     })->values();
103 103
                 }
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
         $second = $parentQuery->qualifyColumn($this->localKey);
138 138
 
139 139
         $query->select($columns)
140
-            ->where(function (Builder $query) use ($first, $second) {
140
+            ->where(function(Builder $query) use ($first, $second) {
141 141
                 $query->whereColumn($first, '=', $second)
142
-                    ->orWhere(function (Builder $query) use ($first, $second) {
142
+                    ->orWhere(function(Builder $query) use ($first, $second) {
143 143
                         $query->whereNull($first)->whereNull($second);
144 144
                     });
145 145
             });
@@ -175,9 +175,9 @@  discard block
 block discarded – undo
175 175
         $second = $this->getQualifiedParentKeyName();
176 176
 
177 177
         $query->select($columns)
178
-            ->where(function (Builder $query) use ($first, $second) {
178
+            ->where(function(Builder $query) use ($first, $second) {
179 179
                 $query->whereColumn($first, '=', $second)
180
-                    ->orWhere(function (Builder $query) use ($first, $second) {
180
+                    ->orWhere(function(Builder $query) use ($first, $second) {
181 181
                         $query->whereNull($first)->whereNull($second);
182 182
                     });
183 183
             });
Please login to merge, or discard this patch.
src/Eloquent/Traits/HasRecursiveRelationshipScopes.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
      */
19 19
     public function scopeTree(Builder $query, $maxDepth = null)
20 20
     {
21
-        $constraint = function (Builder $query) {
21
+        $constraint = function(Builder $query) {
22 22
             $query->isRoot();
23 23
         };
24 24
 
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
      * @param int|null $maxDepth
34 34
      * @return \Illuminate\Database\Eloquent\Builder
35 35
      */
36
-    public function scopeTreeOf(Builder $query, callable|Model $constraint, $maxDepth = null)
36
+    public function scopeTreeOf(Builder $query, callable | Model $constraint, $maxDepth = null)
37 37
     {
38 38
         if ($constraint instanceof Model) {
39
-            $constraint = function ($query) use ($constraint) {
39
+            $constraint = function($query) use ($constraint) {
40 40
                 $query->whereKey($constraint->getKey());
41 41
             };
42 42
         }
@@ -278,20 +278,20 @@  discard block
 block discarded – undo
278 278
     protected function addRecursiveQueryJoinsAndConstraints(Builder $query, $direction, $name, array $joinColumns)
279 279
     {
280 280
         if ($direction === 'both') {
281
-            $query->join($name, function (JoinClause $join) use ($joinColumns) {
281
+            $query->join($name, function(JoinClause $join) use ($joinColumns) {
282 282
                 $join->on($joinColumns['asc'][0], '=', $joinColumns['asc'][1])
283 283
                     ->orOn($joinColumns['desc'][0], '=', $joinColumns['desc'][1]);
284 284
             });
285 285
 
286 286
             $depth = $this->getDepthName();
287 287
 
288
-            $query->where(function (Builder  $query) use ($depth, $joinColumns) {
288
+            $query->where(function(Builder  $query) use ($depth, $joinColumns) {
289 289
                 $query->where($depth, '=', 0)
290
-                    ->orWhere(function (Builder $query) use ($depth, $joinColumns) {
290
+                    ->orWhere(function(Builder $query) use ($depth, $joinColumns) {
291 291
                         $query->whereColumn($joinColumns['asc'][0], '=', $joinColumns['asc'][1])
292 292
                             ->where($depth, '<', 0);
293 293
                     })
294
-                    ->orWhere(function (Builder $query) use ($depth, $joinColumns) {
294
+                    ->orWhere(function(Builder $query) use ($depth, $joinColumns) {
295 295
                         $query->whereColumn($joinColumns['desc'][0], '=', $joinColumns['desc'][1])
296 296
                             ->where($depth, '>', 0);
297 297
                     });
Please login to merge, or discard this patch.