@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | return array_reduce( |
| 24 | 24 | array_keys($haystack), |
| 25 | - static function (bool $valid, $key): bool { |
|
| 25 | + static function(bool $valid, $key): bool { |
|
| 26 | 26 | return true === $valid && true === is_int($key); |
| 27 | 27 | }, |
| 28 | 28 | true |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | return array_reduce( |
| 41 | 41 | array_values($haystack), |
| 42 | - static function (bool $valid, $key) use ($all): bool { |
|
| 42 | + static function(bool $valid, $key) use ($all): bool { |
|
| 43 | 43 | $isArray = true === is_array($key); |
| 44 | 44 | if (true === $all) { |
| 45 | 45 | return true === $valid && true === $isArray; |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | |
| 32 | 32 | return array_reduce( |
| 33 | 33 | $element, |
| 34 | - static function ($valid, $item) use ($all): bool { |
|
| 34 | + static function($valid, $item) use ($all): bool { |
|
| 35 | 35 | $isReference = static::isReference($item); |
| 36 | 36 | if (true === $all) { |
| 37 | 37 | return true === $valid && true === $isReference; |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | if (true === array_key_exists(self::REFERENCE_KEYS_ID, $reference)) { |
| 110 | 110 | $keys['_' . self::REFERENCE_KEYS_ID] = is_numeric($reference[self::REFERENCE_KEYS_ID]) |
| 111 | - ? (int) $reference[self::REFERENCE_KEYS_ID] |
|
| 111 | + ? (int)$reference[self::REFERENCE_KEYS_ID] |
|
| 112 | 112 | : $reference[self::REFERENCE_KEYS_ID]; |
| 113 | 113 | } |
| 114 | 114 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $root = &$relationships[array_shift($pathParts)] ?? []; |
| 187 | 187 | while (count($pathParts) >= 1) { |
| 188 | 188 | $currentPath = array_shift($pathParts); |
| 189 | - $root = &$root[is_numeric($currentPath) ? (int) $currentPath : $currentPath] ?? []; |
|
| 189 | + $root = &$root[is_numeric($currentPath) ? (int)$currentPath : $currentPath] ?? []; |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | $root = array_merge_recursive( |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | unset($relationship[self::REFERENCE_ATTRIBUTES], $relationship[self::REFERENCE_RELATIONSHIPS]); |
| 230 | 230 | |
| 231 | 231 | $relationships = array_map( |
| 232 | - function ($key, $item) { |
|
| 232 | + function($key, $item) { |
|
| 233 | 233 | return $this->parseRelationship($key, $item[self::REFERENCE_DATA] ?? $item); |
| 234 | 234 | }, |
| 235 | 235 | array_keys($relationships), |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | |
| 267 | 267 | $recursiveRelationships = array_filter( |
| 268 | 268 | $relationship, |
| 269 | - static function ($item, $key) { |
|
| 269 | + static function($item, $key) { |
|
| 270 | 270 | return true === is_int($key) || (true === is_array($item) && true === array_key_exists(self::REFERENCE_DATA, $item)); |
| 271 | 271 | }, |
| 272 | 272 | ARRAY_FILTER_USE_BOTH |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | $key => array_merge( |
| 278 | 278 | $this->completeRelationship($normalRelationships) ?? [], |
| 279 | 279 | ...array_map( |
| 280 | - function ($subKey, $item) { |
|
| 280 | + function($subKey, $item) { |
|
| 281 | 281 | if (false === is_int($subKey)) { |
| 282 | 282 | return $this->parseRelationship($subKey, $item[self::REFERENCE_DATA], true); |
| 283 | 283 | } |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | return array_map( |
| 310 | - function ($element) { |
|
| 310 | + function($element) { |
|
| 311 | 311 | return $this->parseData($element); |
| 312 | 312 | }, |
| 313 | 313 | $data |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | if (true === array_key_exists(self::REFERENCE_KEYS_ID, $reference)) { |
| 163 | - $keys[trim(self::REFERENCE_KEYS_ID, '_')] = (string) $reference[self::REFERENCE_KEYS_ID]; |
|
| 163 | + $keys[trim(self::REFERENCE_KEYS_ID, '_')] = (string)$reference[self::REFERENCE_KEYS_ID]; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | return $keys; |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | $attributes = self::filterKeyOrAttributes($reference, true); |
| 249 | 249 | $relationships = array_filter( |
| 250 | 250 | $reference, |
| 251 | - static function ($item, $key) { |
|
| 251 | + static function($item, $key) { |
|
| 252 | 252 | if (true === is_int($key)) { |
| 253 | 253 | return false; |
| 254 | 254 | } |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | $parsedReference = $this->parseReference($elements); |
| 294 | 294 | if (null === $parsedReference) { |
| 295 | 295 | return array_map( |
| 296 | - function ($element) { |
|
| 296 | + function($element) { |
|
| 297 | 297 | return $this->processRecursiveElement($element); |
| 298 | 298 | }, |
| 299 | 299 | $elements |