@@ -87,7 +87,9 @@ discard block |
||
87 | 87 | */ |
88 | 88 | protected function serializeAttributes(object $resource, array|null $fields): array|null |
89 | 89 | { |
90 | - if (($this->options[static::OPTIONS_NO_ATTRIBUTES] ?? false) === true) return null; |
|
90 | + if (($this->options[static::OPTIONS_NO_ATTRIBUTES] ?? false) === true) { |
|
91 | + return null; |
|
92 | + } |
|
91 | 93 | |
92 | 94 | $result = []; |
93 | 95 | |
@@ -109,14 +111,18 @@ discard block |
||
109 | 111 | */ |
110 | 112 | protected function serializeRelationships(object $resource): array|null |
111 | 113 | { |
112 | - if ($this->includeset === null || count($this->includeset) === 0) return null; |
|
114 | + if ($this->includeset === null || count($this->includeset) === 0) { |
|
115 | + return null; |
|
116 | + } |
|
113 | 117 | |
114 | 118 | $relationships = []; |
115 | 119 | $relationshipsMap = $this->metadata->getResourceRelationships($resource); |
116 | 120 | |
117 | 121 | foreach ($this->includeset as $relation => $childIncludeset) { |
118 | 122 | // TODO: Maybe we should throw an exception here |
119 | - if (!isset($relationshipsMap[$relation])) continue; |
|
123 | + if (!isset($relationshipsMap[$relation])) { |
|
124 | + continue; |
|
125 | + } |
|
120 | 126 | |
121 | 127 | $value = $relationshipsMap[$relation]->getValue($resource); |
122 | 128 |
@@ -25,7 +25,9 @@ |
||
25 | 25 | $parserInclude = explode(Includeset::RELATION_SEPARATOR, $item, 2); |
26 | 26 | $relation = array_shift($parserInclude); |
27 | 27 | |
28 | - if (empty($relation)) continue; |
|
28 | + if (empty($relation)) { |
|
29 | + continue; |
|
30 | + } |
|
29 | 31 | |
30 | 32 | $rawChildren = array_shift($parserInclude) ?? ''; |
31 | 33 |