@@ -39,7 +39,7 @@ |
||
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
42 | - throw new RuntimeException('Exception handler for '.get_class($e).' not found.'); |
|
42 | + throw new RuntimeException('Exception handler for ' . get_class($e) . ' not found.'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $resources = []; |
42 | 42 | |
43 | 43 | foreach ($data as $resource) { |
44 | - if (! ($resource instanceof Resource)) { |
|
44 | + if (!($resource instanceof Resource)) { |
|
45 | 45 | $resource = new Resource($resource, $serializer); |
46 | 46 | } |
47 | 47 |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | protected function addPaginationLink($name, $url, array $queryParams, $offset, $limit) |
100 | 100 | { |
101 | - if (! isset($queryParams['page']) || ! is_array($queryParams['page'])) { |
|
101 | + if (!isset($queryParams['page']) || !is_array($queryParams['page'])) { |
|
102 | 102 | $queryParams['page'] = []; |
103 | 103 | } |
104 | 104 | |
@@ -124,6 +124,6 @@ discard block |
||
124 | 124 | |
125 | 125 | $queryString = http_build_query($queryParams); |
126 | 126 | |
127 | - $this->addLink($name, $url.($queryString ? '?'.$queryString : '')); |
|
127 | + $this->addLink($name, $url . ($queryString ? '?' . $queryString : '')); |
|
128 | 128 | } |
129 | 129 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | foreach ($paths as $path) { |
36 | 36 | list($primary, $nested) = array_pad(explode('.', $path, 2), 2, null); |
37 | 37 | |
38 | - if (! isset($tree[$primary])) { |
|
38 | + if (!isset($tree[$primary])) { |
|
39 | 39 | $tree[$primary] = []; |
40 | 40 | } |
41 | 41 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $invalid = array_diff($relationships, $available); |
44 | 44 | |
45 | 45 | if (count($invalid)) { |
46 | - throw new InvalidParameterException('Invalid includes ['.implode(',', $invalid).']'); |
|
46 | + throw new InvalidParameterException('Invalid includes [' . implode(',', $invalid) . ']'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | return $relationships; |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $invalid = array_diff(array_keys($sort), $available); |
138 | 138 | |
139 | 139 | if (count($invalid)) { |
140 | - throw new InvalidParameterException('Invalid sort fields ['.implode(',', $invalid).']'); |
|
140 | + throw new InvalidParameterException('Invalid sort fields [' . implode(',', $invalid) . ']'); |
|
141 | 141 | } |
142 | 142 | } |
143 | 143 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | { |
154 | 154 | $fields = $this->getInput('fields'); |
155 | 155 | |
156 | - if (! is_array($fields)) { |
|
156 | + if (!is_array($fields)) { |
|
157 | 157 | return []; |
158 | 158 | } |
159 | 159 |
@@ -60,7 +60,7 @@ |
||
60 | 60 | if (method_exists($this, $name)) { |
61 | 61 | $relationship = $this->$name($model); |
62 | 62 | |
63 | - if ($relationship !== null && ! ($relationship instanceof Relationship)) { |
|
63 | + if ($relationship !== null && !($relationship instanceof Relationship)) { |
|
64 | 64 | throw new LogicException('Relationship method must return null or an instance of ' |
65 | 65 | .Relationship::class); |
66 | 66 | } |
@@ -65,15 +65,15 @@ |
||
65 | 65 | { |
66 | 66 | $array = []; |
67 | 67 | |
68 | - if (! empty($this->data)) { |
|
68 | + if (!empty($this->data)) { |
|
69 | 69 | $array['data'] = $this->data->toIdentifier(); |
70 | 70 | } |
71 | 71 | |
72 | - if (! empty($this->meta)) { |
|
72 | + if (!empty($this->meta)) { |
|
73 | 73 | $array['meta'] = $this->meta; |
74 | 74 | } |
75 | 75 | |
76 | - if (! empty($this->links)) { |
|
76 | + if (!empty($this->links)) { |
|
77 | 77 | $array['links'] = $this->links; |
78 | 78 | } |
79 | 79 |
@@ -81,26 +81,26 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | $links = []; |
84 | - if (! empty($this->links)) { |
|
84 | + if (!empty($this->links)) { |
|
85 | 85 | $links = $this->links; |
86 | 86 | } |
87 | 87 | $serializerLinks = $this->serializer->getLinks($this->data); |
88 | - if (! empty($serializerLinks)) { |
|
88 | + if (!empty($serializerLinks)) { |
|
89 | 89 | $links = array_merge($serializerLinks, $links); |
90 | 90 | } |
91 | - if (! empty($links)) { |
|
91 | + if (!empty($links)) { |
|
92 | 92 | $array['links'] = $links; |
93 | 93 | } |
94 | 94 | |
95 | 95 | $meta = []; |
96 | - if (! empty($this->meta)) { |
|
96 | + if (!empty($this->meta)) { |
|
97 | 97 | $meta = $this->meta; |
98 | 98 | } |
99 | 99 | $serializerMeta = $this->serializer->getMeta(); |
100 | - if (! empty($serializerMeta)) { |
|
100 | + if (!empty($serializerMeta)) { |
|
101 | 101 | $meta = array_merge($serializerMeta, $meta); |
102 | 102 | } |
103 | - if (! empty($meta)) { |
|
103 | + if (!empty($meta)) { |
|
104 | 104 | $array['meta'] = $meta; |
105 | 105 | } |
106 | 106 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function isIdentifier() |
117 | 117 | { |
118 | - return ! is_object($this->data) && ! is_array($this->data); |
|
118 | + return !is_object($this->data) && !is_array($this->data); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | 'id' => $this->getId() |
129 | 129 | ]; |
130 | 130 | |
131 | - if (! empty($this->meta)) { |
|
131 | + if (!empty($this->meta)) { |
|
132 | 132 | $array['meta'] = $this->meta; |
133 | 133 | } |
134 | 134 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function getId() |
154 | 154 | { |
155 | - if (! is_object($this->data) && ! is_array($this->data)) { |
|
155 | + if (!is_object($this->data) && !is_array($this->data)) { |
|
156 | 156 | return (string) $this->data; |
157 | 157 | } |
158 | 158 |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | // If this resource is the same as the top-level "data" |
85 | 85 | // resource, then we don't want it to show up again in the |
86 | 86 | // "included" array. |
87 | - if (! $includeParent && $child->getType() === $type && $child->getId() === $id) { |
|
87 | + if (!$includeParent && $child->getType() === $type && $child->getId() === $id) { |
|
88 | 88 | continue; |
89 | 89 | } |
90 | 90 | |
@@ -169,11 +169,11 @@ discard block |
||
169 | 169 | { |
170 | 170 | $document = []; |
171 | 171 | |
172 | - if (! empty($this->links)) { |
|
172 | + if (!empty($this->links)) { |
|
173 | 173 | $document['links'] = $this->links; |
174 | 174 | } |
175 | 175 | |
176 | - if (! empty($this->data)) { |
|
176 | + if (!empty($this->data)) { |
|
177 | 177 | $document['data'] = $this->data->toArray(); |
178 | 178 | |
179 | 179 | $resources = $this->getIncluded($this->data); |
@@ -185,15 +185,15 @@ discard block |
||
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
188 | - if (! empty($this->meta)) { |
|
188 | + if (!empty($this->meta)) { |
|
189 | 189 | $document['meta'] = $this->meta; |
190 | 190 | } |
191 | 191 | |
192 | - if (! empty($this->errors)) { |
|
192 | + if (!empty($this->errors)) { |
|
193 | 193 | $document['errors'] = $this->errors; |
194 | 194 | } |
195 | 195 | |
196 | - if (! empty($this->jsonapi)) { |
|
196 | + if (!empty($this->jsonapi)) { |
|
197 | 197 | $document['jsonapi'] = $this->jsonapi; |
198 | 198 | } |
199 | 199 |