@@ -67,7 +67,9 @@ discard block |
||
67 | 67 | |
68 | 68 | protected function serializeAttributes(object $resource, array|null $fields): array|null |
69 | 69 | { |
70 | - if (($this->options[static::OPTIONS_NO_ATTRIBUTES] ?? false) === true) return null; |
|
70 | + if (($this->options[static::OPTIONS_NO_ATTRIBUTES] ?? false) === true) { |
|
71 | + return null; |
|
72 | + } |
|
71 | 73 | |
72 | 74 | $result = []; |
73 | 75 | |
@@ -85,14 +87,18 @@ discard block |
||
85 | 87 | |
86 | 88 | protected function serializeRelationships(object $resource): array|null |
87 | 89 | { |
88 | - if ($this->includeset === null || count($this->includeset) === 0) return null; |
|
90 | + if ($this->includeset === null || count($this->includeset) === 0) { |
|
91 | + return null; |
|
92 | + } |
|
89 | 93 | |
90 | 94 | $relationships = []; |
91 | 95 | $relationshipsMap = $this->metadata->getResourceRelationships($resource); |
92 | 96 | |
93 | 97 | foreach ($this->includeset as $relation => $childIncludeset) { |
94 | 98 | // TODO: Maybe we should throw an exception here |
95 | - if (!isset($relationshipsMap[$relation])) continue; |
|
99 | + if (!isset($relationshipsMap[$relation])) { |
|
100 | + continue; |
|
101 | + } |
|
96 | 102 | |
97 | 103 | $value = $relationshipsMap[$relation]->getValue($resource); |
98 | 104 |
@@ -19,7 +19,9 @@ |
||
19 | 19 | $parserInclude = explode(static::RELATION_SEPARATOR, $item, 2); |
20 | 20 | $relation = array_shift($parserInclude); |
21 | 21 | |
22 | - if (empty($relation)) continue; |
|
22 | + if (empty($relation)) { |
|
23 | + continue; |
|
24 | + } |
|
23 | 25 | |
24 | 26 | $rawChildren = array_shift($parserInclude) ?? ''; |
25 | 27 |