@@ -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 | |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | // and add their resources (and their relationships, and so on) to |
| 287 | 287 | // the map. |
| 288 | 288 | foreach ($include as $name => $nested) { |
| 289 | - if (! ($relationship = $resource->getRelationship($name))) { |
|
| 289 | + if (!($relationship = $resource->getRelationship($name))) { |
|
| 290 | 290 | continue; |
| 291 | 291 | } |
| 292 | 292 | |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | foreach ($paths as $path) { |
| 384 | 384 | list($primary, $nested) = array_pad(explode('.', $path, 2), 2, null); |
| 385 | 385 | |
| 386 | - if (! isset($tree[$primary])) { |
|
| 386 | + if (!isset($tree[$primary])) { |
|
| 387 | 387 | $tree[$primary] = []; |
| 388 | 388 | } |
| 389 | 389 | |
@@ -137,7 +137,7 @@ |
||
| 137 | 137 | /** |
| 138 | 138 | * Set the errors array. |
| 139 | 139 | * |
| 140 | - * @param Error[]|null $errors |
|
| 140 | + * @param Error[] $errors |
|
| 141 | 141 | */ |
| 142 | 142 | public function setErrors(array $errors = null) |
| 143 | 143 | { |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | if (method_exists($this, $method)) { |
| 54 | 54 | $relationship = $this->$method(); |
| 55 | 55 | |
| 56 | - if ($relationship !== null && ! ($relationship instanceof Relationship)) { |
|
| 56 | + if ($relationship !== null && !($relationship instanceof Relationship)) { |
|
| 57 | 57 | throw new LogicException('Relationship method must return null or an instance of Tobscure\JsonApi\Relationship'); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -55,7 +55,6 @@ |
||
| 55 | 55 | * Remove a piece of meta data. |
| 56 | 56 | * |
| 57 | 57 | * @param string $key |
| 58 | - * @param mixed $value |
|
| 59 | 58 | */ |
| 60 | 59 | public function removeMeta($key) |
| 61 | 60 | { |
@@ -13,7 +13,15 @@ |
||
| 13 | 13 | |
| 14 | 14 | trait PaginationLinksTrait |
| 15 | 15 | { |
| 16 | + /** |
|
| 17 | + * @param string $key |
|
| 18 | + * @param string $value |
|
| 19 | + */ |
|
| 16 | 20 | abstract public function setLink($key, $value); |
| 21 | + |
|
| 22 | + /** |
|
| 23 | + * @param string $key |
|
| 24 | + */ |
|
| 17 | 25 | abstract public function removeLink($key); |
| 18 | 26 | |
| 19 | 27 | /** |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | */ |
| 62 | 62 | private function setPaginationLink($name, $url, array $queryParams, $offset, $limit) |
| 63 | 63 | { |
| 64 | - if (! isset($queryParams['page']) || ! is_array($queryParams['page'])) { |
|
| 64 | + if (!isset($queryParams['page']) || !is_array($queryParams['page'])) { |
|
| 65 | 65 | $queryParams['page'] = []; |
| 66 | 66 | } |
| 67 | 67 | |
@@ -13,7 +13,14 @@ |
||
| 13 | 13 | |
| 14 | 14 | trait RelatedLinkTrait |
| 15 | 15 | { |
| 16 | + /** |
|
| 17 | + * @param string $key |
|
| 18 | + */ |
|
| 16 | 19 | abstract public function setLink($key, $value); |
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * @param string $key |
|
| 23 | + */ |
|
| 17 | 24 | abstract public function removeLink($key); |
| 18 | 25 | |
| 19 | 26 | /** |
@@ -13,7 +13,14 @@ |
||
| 13 | 13 | |
| 14 | 14 | trait SelfLinkTrait |
| 15 | 15 | { |
| 16 | + /** |
|
| 17 | + * @param string $key |
|
| 18 | + */ |
|
| 16 | 19 | abstract public function setLink($key, $value); |
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * @param string $key |
|
| 23 | + */ |
|
| 17 | 24 | abstract public function removeLink($key); |
| 18 | 25 | |
| 19 | 26 | /** |