@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | public function addConstraints() |
| 22 | 22 | { |
| 23 | 23 | if (static::$constraints) { |
| 24 | - $constraint = function (Builder $query) { |
|
| 24 | + $constraint = function(Builder $query) { |
|
| 25 | 25 | if ($this->andSelf) { |
| 26 | 26 | $query->where($this->getQualifiedLocalKeyName(), '=', $this->getParentKey()); |
| 27 | 27 | } else { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $keys = $this->getKeys($models, $this->localKey); |
| 50 | 50 | |
| 51 | - $constraint = function (Builder $query) use ($models, $whereIn, $column, $keys) { |
|
| 51 | + $constraint = function(Builder $query) use ($models, $whereIn, $column, $keys) { |
|
| 52 | 52 | $query->$whereIn($column, $keys); |
| 53 | 53 | }; |
| 54 | 54 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | $foreignKey = $this->getForeignKeyName(); |
| 98 | 98 | |
| 99 | - return $results->mapToDictionary(function (Model $result) use ($dictionary, $foreignKey) { |
|
| 99 | + return $results->mapToDictionary(function(Model $result) use ($dictionary, $foreignKey) { |
|
| 100 | 100 | if ($result->hasNestedPath()) { |
| 101 | 101 | $key = $dictionary[$result->getFirstPathSegment()]->{$foreignKey}; |
| 102 | 102 | } else { |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | ? $query->getQuery()->from.'.'.$this->localKey |
| 126 | 126 | : $this->foreignKey; |
| 127 | 127 | |
| 128 | - $constraint = function (Builder $query) use ($first) { |
|
| 128 | + $constraint = function(Builder $query) use ($first) { |
|
| 129 | 129 | $query->whereColumn( |
| 130 | 130 | $first, |
| 131 | 131 | '=', |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | ? $table.'.'.$this->localKey |
| 157 | 157 | : $table.'.'.$this->getForeignKeyName(); |
| 158 | 158 | |
| 159 | - $constraint = function (Builder $query) use ($first) { |
|
| 159 | + $constraint = function(Builder $query) use ($first) { |
|
| 160 | 160 | $query->whereColumn( |
| 161 | 161 | $first, |
| 162 | 162 | '=', |
@@ -22,6 +22,6 @@ |
||
| 22 | 22 | { |
| 23 | 23 | $path = $this->model->getPathName(); |
| 24 | 24 | |
| 25 | - return $this->wrap($path) . ' asc'; |
|
| 25 | + return $this->wrap($path).' asc'; |
|
| 26 | 26 | } |
| 27 | 27 | } |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | |
| 559 | 559 | $relatedPivotKey = $relatedPivotKey ?: $instance->getForeignKey(); |
| 560 | 560 | |
| 561 | - if (! $table) { |
|
| 561 | + if (!$table) { |
|
| 562 | 562 | $words = preg_split('/(_)/u', $name, -1, PREG_SPLIT_DELIM_CAPTURE); |
| 563 | 563 | |
| 564 | 564 | $lastWord = array_pop($words); |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | |
| 607 | 607 | $relatedPivotKey = $relatedPivotKey ?: $instance->getForeignKey(); |
| 608 | 608 | |
| 609 | - if (! $table) { |
|
| 609 | + if (!$table) { |
|
| 610 | 610 | $words = preg_split('/(_)/u', $name, -1, PREG_SPLIT_DELIM_CAPTURE); |
| 611 | 611 | |
| 612 | 612 | $lastWord = array_pop($words); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | public function addConstraints() |
| 19 | 19 | { |
| 20 | 20 | if (static::$constraints) { |
| 21 | - $constraint = function (Builder $query) { |
|
| 21 | + $constraint = function(Builder $query) { |
|
| 22 | 22 | $key = $this->andSelf ? $this->getParentKey() : $this->getForeignKey(); |
| 23 | 23 | |
| 24 | 24 | $query->where($this->getQualifiedLocalKeyName(), '=', $key); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $keys = $this->getKeys($models, $key); |
| 44 | 44 | |
| 45 | - $constraint = function (Builder $query) use ($whereIn, $keys) { |
|
| 45 | + $constraint = function(Builder $query) use ($whereIn, $keys) { |
|
| 46 | 46 | $query->$whereIn($this->getQualifiedLocalKeyName(), $keys); |
| 47 | 47 | }; |
| 48 | 48 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | { |
| 61 | 61 | $keys = parent::getKeys($models, $key); |
| 62 | 62 | |
| 63 | - return array_filter($keys, function ($value) { |
|
| 63 | + return array_filter($keys, function($value) { |
|
| 64 | 64 | return !is_null($value); |
| 65 | 65 | }); |
| 66 | 66 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | $key = $this->andSelf ? $this->localKey : $this->getForeignKeyName(); |
| 110 | 110 | |
| 111 | - $constraint = function (Builder $query) use ($key) { |
|
| 111 | + $constraint = function(Builder $query) use ($key) { |
|
| 112 | 112 | $query->whereColumn( |
| 113 | 113 | $query->getQuery()->from.'.'.$this->localKey, |
| 114 | 114 | '=', |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | $key = $this->andSelf ? $this->localKey : $this->getForeignKeyName(); |
| 139 | 139 | |
| 140 | - $constraint = function (Builder $query) use ($table, $key) { |
|
| 140 | + $constraint = function(Builder $query) use ($table, $key) { |
|
| 141 | 141 | $query->whereColumn( |
| 142 | 142 | $table.'.'.$this->localKey, |
| 143 | 143 | '=', |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | public function addConstraints() |
| 34 | 34 | { |
| 35 | 35 | if (static::$constraints) { |
| 36 | - $constraint = function (Builder $query) { |
|
| 36 | + $constraint = function(Builder $query) { |
|
| 37 | 37 | $this->addExpressionWhereConstraints($query); |
| 38 | 38 | }; |
| 39 | 39 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function addEagerConstraints(array $models) |
| 59 | 59 | { |
| 60 | - $constraint = function (Builder $query) use ($models) { |
|
| 60 | + $constraint = function(Builder $query) use ($models) { |
|
| 61 | 61 | $this->addEagerExpressionWhereConstraints($query, $models); |
| 62 | 62 | }; |
| 63 | 63 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | |
| 205 | 205 | $query->withRecursiveExpression($name, $expression); |
| 206 | 206 | |
| 207 | - $query->withGlobalScope(get_class(), function (Builder $query) use ($name) { |
|
| 207 | + $query->withGlobalScope(get_class(), function(Builder $query) use ($name) { |
|
| 208 | 208 | $query->whereIn( |
| 209 | 209 | $this->getExpressionForeignKeyName(), |
| 210 | 210 | (new $this->parent())->setTable($name) |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | $alias = null; |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | - $constraint = function (Builder $query) use ($table) { |
|
| 322 | + $constraint = function(Builder $query) use ($table) { |
|
| 323 | 323 | $this->addExistenceExpressionWhereConstraints($query, $table); |
| 324 | 324 | }; |
| 325 | 325 | |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | */ |
| 41 | 41 | protected function buildDictionary(Collection $results) |
| 42 | 42 | { |
| 43 | - return $results->mapToDictionary(function (Model $result) { |
|
| 43 | + return $results->mapToDictionary(function(Model $result) { |
|
| 44 | 44 | return [$result->getFirstPathSegment() => $result]; |
| 45 | 45 | })->all(); |
| 46 | 46 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function getQualifiedParentKeyName() |
| 46 | 46 | { |
| 47 | - return $this->getPivotTableName() . '.' . $this->getParentKeyName(); |
|
| 47 | + return $this->getPivotTableName().'.'.$this->getParentKeyName(); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function getQualifiedChildKeyName() |
| 66 | 66 | { |
| 67 | - return $this->getPivotTableName() . '.' . $this->getChildKeyName(); |
|
| 67 | + return $this->getPivotTableName().'.'.$this->getChildKeyName(); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | { |
| 149 | 149 | foreach (static::$treeRelationMap as $relationDefinition) { |
| 150 | 150 | $type = $relationDefinition['manyRelation'] |
| 151 | - ? '\\' . Collection::class . '|' . class_basename($model) . '[]' |
|
| 151 | + ? '\\'.Collection::class.'|'.class_basename($model).'[]' |
|
| 152 | 152 | : class_basename($model); |
| 153 | 153 | |
| 154 | 154 | $command->setProperty( |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | if ($relationDefinition['manyRelation']) { |
| 164 | 164 | $command->setProperty( |
| 165 | - Str::snake($relationDefinition['name']) . '_count', |
|
| 165 | + Str::snake($relationDefinition['name']).'_count', |
|
| 166 | 166 | 'int', |
| 167 | 167 | true, |
| 168 | 168 | false, |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | protected function setGraphRelationProperties(ModelsCommand $command, Model $model): void |
| 177 | 177 | { |
| 178 | 178 | foreach (static::$graphRelationMap as $relationDefinition) { |
| 179 | - $type = '\\' . EloquentCollection::class . '|' . class_basename($model) . '[]'; |
|
| 179 | + $type = '\\'.EloquentCollection::class.'|'.class_basename($model).'[]'; |
|
| 180 | 180 | |
| 181 | 181 | $command->setProperty( |
| 182 | 182 | $relationDefinition['name'], |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | if ($relationDefinition['manyRelation']) { |
| 191 | 191 | $command->setProperty( |
| 192 | - Str::snake($relationDefinition['name']) . '_count', |
|
| 192 | + Str::snake($relationDefinition['name']).'_count', |
|
| 193 | 193 | 'int', |
| 194 | 194 | true, |
| 195 | 195 | false, |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function compileCycleDetectionInitialSelect(string $column): string |
| 112 | 112 | { |
| 113 | - return '0 as ' . $this->wrap($column); |
|
| 113 | + return '0 as '.$this->wrap($column); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | public function compileCycleDetectionRecursiveSelect(string $sql, string $column): string |
| 124 | 124 | { |
| 125 | - return "case when $sql then 1 else 0 end as " . $this->wrap($column); |
|
| 125 | + return "case when $sql then 1 else 0 end as ".$this->wrap($column); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function compileCycleDetectionStopConstraint(string $column): string |
| 135 | 135 | { |
| 136 | - return $this->wrap($column) . ' = 0'; |
|
| 136 | + return $this->wrap($column).' = 0'; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |