@@ -33,13 +33,13 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function pipe($resource, Context $context, Path $path, $data) |
| 35 | 35 | { |
| 36 | - if (! $context instanceof HasSchema) { |
|
| 36 | + if (!$context instanceof HasSchema) { |
|
| 37 | 37 | return $data; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | $transformer = $this->transformerRepository->getTransformer($resource); |
| 41 | 41 | |
| 42 | - if (! $transformer instanceof HasLazyProperties) { |
|
| 42 | + if (!$transformer instanceof HasLazyProperties) { |
|
| 43 | 43 | return $data; |
| 44 | 44 | } |
| 45 | 45 | |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | return array_reduce( |
| 51 | 51 | $properties, |
| 52 | - function (array $data, string $key) use ($resource, $transformer) { |
|
| 53 | - if (! array_key_exists($key, $data)) { |
|
| 52 | + function(array $data, string $key) use ($resource, $transformer) { |
|
| 53 | + if (!array_key_exists($key, $data)) { |
|
| 54 | 54 | $data[$key] = $transformer->{$key}($resource); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -62,15 +62,15 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | private function getProperties(array $schema): array |
| 64 | 64 | { |
| 65 | - return array_map(function ($value, $key) { |
|
| 65 | + return array_map(function($value, $key) { |
|
| 66 | 66 | return is_string($value) ? $value : $key; |
| 67 | 67 | }, $schema, array_keys($schema)); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | private function getPathSchema(Path $path, array $schema): array |
| 71 | 71 | { |
| 72 | - $segments = array_filter($path->getSegments(), function ($segment) { |
|
| 73 | - return ! is_numeric($segment); |
|
| 72 | + $segments = array_filter($path->getSegments(), function($segment) { |
|
| 73 | + return !is_numeric($segment); |
|
| 74 | 74 | }); |
| 75 | 75 | |
| 76 | 76 | return $this->arrayGet($schema, $segments, []); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | private function arrayGet(array $array, array $path, $default): array |
| 80 | 80 | { |
| 81 | 81 | foreach ($path as $key) { |
| 82 | - if (! array_key_exists($key, $array)) { |
|
| 82 | + if (!array_key_exists($key, $array)) { |
|
| 83 | 83 | return $default; |
| 84 | 84 | } |
| 85 | 85 | |