@@ -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 | |
@@ -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($this->data); |
| 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 | /** |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function toIdentifier() |
| 125 | 125 | { |
| 126 | - if (! $this->data) { |
|
| 126 | + if (!$this->data) { |
|
| 127 | 127 | return null; |
| 128 | 128 | } |
| 129 | 129 | |
@@ -131,11 +131,11 @@ discard block |
||
| 131 | 131 | 'type' => $this->getType() |
| 132 | 132 | ]; |
| 133 | 133 | |
| 134 | - if($this->getId()) { |
|
| 134 | + if ($this->getId()) { |
|
| 135 | 135 | $array['id'] = $this->getId(); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - if (! empty($this->meta)) { |
|
| 138 | + if (!empty($this->meta)) { |
|
| 139 | 139 | $array['meta'] = $this->meta; |
| 140 | 140 | } |
| 141 | 141 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | public function getId() |
| 161 | 161 | { |
| 162 | - if (! is_object($this->data) && ! is_array($this->data)) { |
|
| 162 | + if (!is_object($this->data) && !is_array($this->data)) { |
|
| 163 | 163 | return (string) $this->data; |
| 164 | 164 | } |
| 165 | 165 | |