@@ -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 | } |
@@ -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 | '=', |
@@ -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 | /** |
@@ -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 | /** |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | if (static::$constraints) { |
| 25 | 25 | $column = $this->andSelf ? $this->getQualifiedParentKeyName() : $this->getQualifiedRelatedPivotKeyName(); |
| 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 |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | $first = $this->andSelf |
| 104 | - ? $query->getQuery()->from . '.' . $this->parentKey |
|
| 104 | + ? $query->getQuery()->from.'.'.$this->parentKey |
|
| 105 | 105 | : $this->getQualifiedRelatedPivotKeyName(); |
| 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 |
||
| 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 |
||
| 140 | 140 | ? "$table.$this->parentKey" |
| 141 | 141 | : "$this->table.$this->relatedPivotKey"; |
| 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 | '=', |
@@ -24,7 +24,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | '=', |
@@ -107,7 +107,7 @@ discard block |
||
| 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 |
||
| 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 | /** |
@@ -71,7 +71,7 @@ |
||
| 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]; |