Completed
Pull Request — master (#119)
by Toby
03:12
created
src/Parameters.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Document.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             $relationships = [];
179 179
 
180 180
             foreach ($include as $name => $nested) {
181
-                if (! ($relationship = $resource->getRelationship($name))) {
181
+                if (!($relationship = $resource->getRelationship($name))) {
182 182
                     continue;
183 183
                 }
184 184
 
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
             $array = &$tree;
250 250
 
251 251
             foreach ($keys as $key) {
252
-                if (! isset($array[$key])) {
252
+                if (!isset($array[$key])) {
253 253
                     $array[$key] = [];
254 254
                 }
255 255
 
Please login to merge, or discard this patch.
src/PaginationLinksTrait.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -13,8 +13,15 @@
 block discarded – undo
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);
17 21
 
22
+    /**
23
+     * @param string $key
24
+     */
18 25
     abstract public function removeLink($key);
19 26
 
20 27
     /**
Please login to merge, or discard this patch.
src/RelatedLinkTrait.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -13,8 +13,14 @@
 block discarded – undo
13 13
 
14 14
 trait RelatedLinkTrait
15 15
 {
16
+    /**
17
+     * @param string $key
18
+     */
16 19
     abstract public function setLink($key, $value);
17 20
 
21
+    /**
22
+     * @param string $key
23
+     */
18 24
     abstract public function removeLink($key);
19 25
 
20 26
     /**
Please login to merge, or discard this patch.
src/SelfLinkTrait.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -13,8 +13,14 @@
 block discarded – undo
13 13
 
14 14
 trait SelfLinkTrait
15 15
 {
16
+    /**
17
+     * @param string $key
18
+     */
16 19
     abstract public function setLink($key, $value);
17 20
 
21
+    /**
22
+     * @param string $key
23
+     */
18 24
     abstract public function removeLink($key);
19 25
 
20 26
     /**
Please login to merge, or discard this patch.
src/MetaTrait.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,6 @@
 block discarded – undo
40 40
      * Remove a piece of meta data.
41 41
      *
42 42
      * @param string $key
43
-     * @param mixed $value
44 43
      */
45 44
     public function removeMetaItem($key)
46 45
     {
Please login to merge, or discard this patch.
src/AbstractResource.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
 
72 72
         $relationship = $this->$method();
73 73
 
74
-        if ($relationship !== null && ! ($relationship instanceof Relationship)) {
74
+        if ($relationship !== null && !($relationship instanceof Relationship)) {
75 75
             throw new LogicException('Relationship method must return null or an instance of Tobscure\JsonApi\Relationship');
76 76
         }
77 77
 
Please login to merge, or discard this patch.
src/ResourceObject.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
     public function setAttribute($name, $value)
25 25
     {
26
-        if (! $this->validateField($name)) {
26
+        if (!$this->validateField($name)) {
27 27
             throw new InvalidArgumentException('Invalid attribute name');
28 28
         }
29 29
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
     public function setRelationship($name, Relationship $value)
38 38
     {
39
-        if (! $this->validateField($name)) {
39
+        if (!$this->validateField($name)) {
40 40
             throw new InvalidArgumentException('Invalid relationship name');
41 41
         }
42 42
 
@@ -60,6 +60,6 @@  discard block
 block discarded – undo
60 60
 
61 61
     private function validateField($name)
62 62
     {
63
-        return ! in_array($name, ['id', 'type']);
63
+        return !in_array($name, ['id', 'type']);
64 64
     }
65 65
 }
Please login to merge, or discard this patch.