Passed
Pull Request — master (#58)
by Alberto
03:13 queued 45s
created
src/Controller/Component/ApiFormatterComponent.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function embedIncluded(array $response): array
34 34
     {
35
-        $data = (array)Hash::get($response, 'data');
35
+        $data = (array) Hash::get($response, 'data');
36 36
         if (empty($data)) {
37 37
             return $response;
38 38
         }
39 39
 
40
-        $included = (array)Hash::get($response, 'included');
40
+        $included = (array) Hash::get($response, 'included');
41 41
         if (empty($included)) {
42 42
             return $response;
43 43
         }
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
                 continue;
74 74
             }
75 75
 
76
-            $relation['data'] = $this->extractFromIncluded($included, (array)$relation['data']);
76
+            $relation['data'] = $this->extractFromIncluded($included, (array) $relation['data']);
77 77
         }
78 78
         unset($relation);
79 79
 
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
     {
93 93
         // case is 1-1 relationship - object relation in translations is a special case
94 94
         if (array_key_exists('id', $relationshipData)) {
95
-            return (array)$included->firstMatch([
95
+            return (array) $included->firstMatch([
96 96
                 'type' => $relationshipData['type'],
97 97
                 'id' => $relationshipData['id'],
98 98
             ]);
99 99
         }
100 100
         foreach ($relationshipData as &$data) {
101
-            $data = (array)$included->firstMatch([
101
+            $data = (array) $included->firstMatch([
102 102
                 'type' => $data['type'],
103 103
                 'id' => $data['id'],
104 104
             ]);
Please login to merge, or discard this patch.
src/Policy/RequestRolesPolicy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@
 block discarded – undo
159 159
      */
160 160
     protected function applyRolesPolicy(IdentityInterface $identity, array $roles): Result
161 161
     {
162
-        $identityRoles = (array)Hash::get((array)$identity->getOriginalData(), 'roles');
162
+        $identityRoles = (array) Hash::get((array) $identity->getOriginalData(), 'roles');
163 163
 
164 164
         if (!empty(array_intersect($identityRoles, $roles))) {
165 165
             return new Result(true);
Please login to merge, or discard this patch.
src/Identity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,6 +29,6 @@
 block discarded – undo
29 29
      */
30 30
     public function hasRole(string $name): bool
31 31
     {
32
-        return in_array($name, (array)$this->get('roles'));
32
+        return in_array($name, (array) $this->get('roles'));
33 33
     }
34 34
 }
Please login to merge, or discard this patch.
src/View/Helper/IdentityHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
      */
46 46
     public function __call($method, $args)
47 47
     {
48
-        if (!in_array($method, (array)$this->getConfig('delegateMethods'))) {
48
+        if (!in_array($method, (array) $this->getConfig('delegateMethods'))) {
49 49
             throw new \BadMethodCallException("Cannot call `{$method}`. Make sure to add it to `delegateMethods`.");
50 50
         }
51 51
 
Please login to merge, or discard this patch.