@@ -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 | /** |
@@ -159,11 +159,11 @@ discard block |
||
159 | 159 | { |
160 | 160 | $document = []; |
161 | 161 | |
162 | - if (! empty($this->links)) { |
|
162 | + if (!empty($this->links)) { |
|
163 | 163 | $document['links'] = $this->links; |
164 | 164 | } |
165 | 165 | |
166 | - if (! empty($this->data)) { |
|
166 | + if (!empty($this->data)) { |
|
167 | 167 | $document['data'] = $this->data->toArray(); |
168 | 168 | |
169 | 169 | $resources = $this->getIncluded($this->data); |
@@ -175,15 +175,15 @@ discard block |
||
175 | 175 | } |
176 | 176 | } |
177 | 177 | |
178 | - if (! empty($this->meta)) { |
|
178 | + if (!empty($this->meta)) { |
|
179 | 179 | $document['meta'] = $this->meta; |
180 | 180 | } |
181 | 181 | |
182 | - if (! empty($this->errors)) { |
|
182 | + if (!empty($this->errors)) { |
|
183 | 183 | $document['errors'] = $this->errors; |
184 | 184 | } |
185 | 185 | |
186 | - if (! empty($this->jsonapi)) { |
|
186 | + if (!empty($this->jsonapi)) { |
|
187 | 187 | $document['jsonapi'] = $this->jsonapi; |
188 | 188 | } |
189 | 189 |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $array['relationships'] = $relationships; |
81 | 81 | } |
82 | 82 | |
83 | - if (! empty($this->links)) { |
|
83 | + if (!empty($this->links)) { |
|
84 | 84 | $array['links'] = $this->links; |
85 | 85 | } |
86 | 86 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function isIdentifier() |
97 | 97 | { |
98 | - return ! is_object($this->data) && ! is_array($this->data); |
|
98 | + return !is_object($this->data) && !is_array($this->data); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | 'id' => $this->getId() |
109 | 109 | ]; |
110 | 110 | |
111 | - if (! empty($this->meta)) { |
|
111 | + if (!empty($this->meta)) { |
|
112 | 112 | $array['meta'] = $this->meta; |
113 | 113 | } |
114 | 114 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | public function getId() |
134 | 134 | { |
135 | - if (! is_object($this->data) && ! is_array($this->data)) { |
|
135 | + if (!is_object($this->data) && !is_array($this->data)) { |
|
136 | 136 | return (string) $this->data; |
137 | 137 | } |
138 | 138 |
@@ -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 |