@@ -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 |
@@ -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 |
@@ -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 |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | foreach ($resource->getUnfilteredRelationships() as $relationship) { |
81 | 81 | $includedElement = $relationship->getData(); |
82 | 82 | |
83 | - if (! $includedElement instanceof ElementInterface) { |
|
83 | + if (!$includedElement instanceof ElementInterface) { |
|
84 | 84 | continue; |
85 | 85 | } |
86 | 86 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | // If this resource is the same as the top-level "data" |
89 | 89 | // resource, then we don't want it to show up again in the |
90 | 90 | // "included" array. |
91 | - if (! $includeParent && $child->getType() === $type && $child->getId() === $id) { |
|
91 | + if (!$includeParent && $child->getType() === $type && $child->getId() === $id) { |
|
92 | 92 | continue; |
93 | 93 | } |
94 | 94 | |
@@ -173,11 +173,11 @@ discard block |
||
173 | 173 | { |
174 | 174 | $document = []; |
175 | 175 | |
176 | - if (! empty($this->links)) { |
|
176 | + if (!empty($this->links)) { |
|
177 | 177 | $document['links'] = $this->links; |
178 | 178 | } |
179 | 179 | |
180 | - if (! empty($this->data)) { |
|
180 | + if (!empty($this->data)) { |
|
181 | 181 | $document['data'] = $this->data->toArray(); |
182 | 182 | |
183 | 183 | $resources = $this->getIncluded($this->data); |
@@ -189,15 +189,15 @@ discard block |
||
189 | 189 | } |
190 | 190 | } |
191 | 191 | |
192 | - if (! empty($this->meta)) { |
|
192 | + if (!empty($this->meta)) { |
|
193 | 193 | $document['meta'] = $this->meta; |
194 | 194 | } |
195 | 195 | |
196 | - if (! empty($this->errors)) { |
|
196 | + if (!empty($this->errors)) { |
|
197 | 197 | $document['errors'] = $this->errors; |
198 | 198 | } |
199 | 199 | |
200 | - if (! empty($this->jsonapi)) { |
|
200 | + if (!empty($this->jsonapi)) { |
|
201 | 201 | $document['jsonapi'] = $this->jsonapi; |
202 | 202 | } |
203 | 203 |
@@ -98,7 +98,7 @@ |
||
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 |
@@ -162,7 +162,7 @@ |
||
162 | 162 | { |
163 | 163 | $fields = $this->getInput('fields'); |
164 | 164 | |
165 | - if (! is_array($fields)) { |
|
165 | + if (!is_array($fields)) { |
|
166 | 166 | return []; |
167 | 167 | } |
168 | 168 |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | $array = $this->toIdentifier(); |
74 | 74 | |
75 | - if (! $this->isIdentifier()) { |
|
75 | + if (!$this->isIdentifier()) { |
|
76 | 76 | $array['attributes'] = $this->getAttributes(); |
77 | 77 | } |
78 | 78 | |
@@ -83,26 +83,26 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | $links = []; |
86 | - if (! empty($this->links)) { |
|
86 | + if (!empty($this->links)) { |
|
87 | 87 | $links = $this->links; |
88 | 88 | } |
89 | 89 | $serializerLinks = $this->serializer->getLinks($this->data); |
90 | - if (! empty($serializerLinks)) { |
|
90 | + if (!empty($serializerLinks)) { |
|
91 | 91 | $links = array_merge($serializerLinks, $links); |
92 | 92 | } |
93 | - if (! empty($links)) { |
|
93 | + if (!empty($links)) { |
|
94 | 94 | $array['links'] = $links; |
95 | 95 | } |
96 | 96 | |
97 | 97 | $meta = []; |
98 | - if (! empty($this->meta)) { |
|
98 | + if (!empty($this->meta)) { |
|
99 | 99 | $meta = $this->meta; |
100 | 100 | } |
101 | 101 | $serializerMeta = $this->serializer->getMeta($this->data); |
102 | - if (! empty($serializerMeta)) { |
|
102 | + if (!empty($serializerMeta)) { |
|
103 | 103 | $meta = array_merge($serializerMeta, $meta); |
104 | 104 | } |
105 | - if (! empty($meta)) { |
|
105 | + if (!empty($meta)) { |
|
106 | 106 | $array['meta'] = $meta; |
107 | 107 | } |
108 | 108 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function isIdentifier() |
119 | 119 | { |
120 | - return ! is_object($this->data) && ! is_array($this->data); |
|
120 | + return !is_object($this->data) && !is_array($this->data); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function toIdentifier() |
127 | 127 | { |
128 | - if (! $this->data) { |
|
128 | + if (!$this->data) { |
|
129 | 129 | return null; |
130 | 130 | } |
131 | 131 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | 'id' => $this->getId() |
135 | 135 | ]; |
136 | 136 | |
137 | - if (! empty($this->meta)) { |
|
137 | + if (!empty($this->meta)) { |
|
138 | 138 | $array['meta'] = $this->meta; |
139 | 139 | } |
140 | 140 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | public function getId() |
160 | 160 | { |
161 | - if (! is_object($this->data) && ! is_array($this->data)) { |
|
161 | + if (!is_object($this->data) && !is_array($this->data)) { |
|
162 | 162 | return (string) $this->data; |
163 | 163 | } |
164 | 164 |