@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function detach($ids = null) |
| 36 | 36 | { |
| 37 | - if (! is_null($ids)) { |
|
| 37 | + if (!is_null($ids)) { |
|
| 38 | 38 | $records = array_diff_key( |
| 39 | 39 | $this->decodeRecords(), |
| 40 | 40 | array_flip($this->parseIds($ids)) |
@@ -97,8 +97,8 @@ discard block |
||
| 97 | 97 | $key = str_replace('->', '.', $this->key); |
| 98 | 98 | |
| 99 | 99 | return collect((array) $this->child->{$this->path}) |
| 100 | - ->mapWithKeys(function ($record) use ($key) { |
|
| 101 | - if (! is_array($record)) { |
|
| 100 | + ->mapWithKeys(function($record) use ($key) { |
|
| 101 | + if (!is_array($record)) { |
|
| 102 | 102 | return [$record => []]; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | protected function encodeRecords(array $records) |
| 116 | 116 | { |
| 117 | - if (! $this->key) { |
|
| 117 | + if (!$this->key) { |
|
| 118 | 118 | return array_keys($records); |
| 119 | 119 | } |
| 120 | 120 | |
@@ -158,8 +158,8 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | protected function formatIds(array $ids) |
| 160 | 160 | { |
| 161 | - return collect($ids)->mapWithKeys(function ($attributes, $id) { |
|
| 162 | - if (! is_array($attributes)) { |
|
| 161 | + return collect($ids)->mapWithKeys(function($attributes, $id) { |
|
| 162 | + if (!is_array($attributes)) { |
|
| 163 | 163 | [$id, $attributes] = [$attributes, []]; |
| 164 | 164 | } |
| 165 | 165 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function getResults() |
| 21 | 21 | { |
| 22 | - return ! empty($this->getForeignKeys()) |
|
| 22 | + return !empty($this->getForeignKeys()) |
|
| 23 | 23 | ? $this->get() |
| 24 | 24 | : $this->related->newCollection(); |
| 25 | 25 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | { |
| 161 | 161 | $ownerKey = $query->qualifyColumn($ownerKey); |
| 162 | 162 | |
| 163 | - if (! $this->key) { |
|
| 163 | + if (!$this->key) { |
|
| 164 | 164 | return $this->getJsonGrammar($query)->compileJsonArray($ownerKey); |
| 165 | 165 | } |
| 166 | 166 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $key = str_replace('->', '.', $this->key); |
| 182 | 182 | |
| 183 | 183 | $record = collect($parent->{$this->path}) |
| 184 | - ->filter(function ($value) use ($key, $model) { |
|
| 184 | + ->filter(function($value) use ($key, $model) { |
|
| 185 | 185 | return Arr::get($value, $key) == $model->{$this->ownerKey}; |
| 186 | 186 | })->first(); |
| 187 | 187 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function getResults() |
| 21 | 21 | { |
| 22 | - return ! is_null($this->getParentKey()) |
|
| 22 | + return !is_null($this->getParentKey()) |
|
| 23 | 23 | ? $this->get() |
| 24 | 24 | : $this->related->newCollection(); |
| 25 | 25 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | $parentKeys = $this->getKeys($models, $this->localKey); |
| 54 | 54 | |
| 55 | - $this->query->where(function (Builder $query) use ($parentKeys) { |
|
| 55 | + $this->query->where(function(Builder $query) use ($parentKeys) { |
|
| 56 | 56 | foreach ($parentKeys as $parentKey) { |
| 57 | 57 | if ($this->key) { |
| 58 | 58 | $parentKey = $this->parentKeyToArray($parentKey); |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | { |
| 194 | 194 | $parentKey = $this->getQualifiedParentKeyName(); |
| 195 | 195 | |
| 196 | - if (! $this->key) { |
|
| 196 | + if (!$this->key) { |
|
| 197 | 197 | return $this->getJsonGrammar($query)->compileJsonArray($parentKey); |
| 198 | 198 | } |
| 199 | 199 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $key = str_replace('->', '.', $this->key); |
| 215 | 215 | |
| 216 | 216 | $record = collect($model->{$this->getPathName()}) |
| 217 | - ->filter(function ($value) use ($key, $parent) { |
|
| 217 | + ->filter(function($value) use ($key, $parent) { |
|
| 218 | 218 | return Arr::get($value, $key) == $parent->{$this->localKey}; |
| 219 | 219 | })->first(); |
| 220 | 220 | |