Passed
Pull Request — master (#54)
by Paolo
02:49
created
src/View/Twig/BeditaTwigExtension.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     {
38 38
         return [
39 39
             new \Twig_SimpleFunction('config', [Configure::class, 'read']),
40
-            new \Twig_SimpleFunction('write_config', function ($key, $val) {
40
+            new \Twig_SimpleFunction('write_config', function($key, $val) {
41 41
                 // avoid unwanted return value display in templates
42 42
                 Configure::write($key, $val);
43 43
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         return [
55 55
             new \Twig_SimpleFilter(
56 56
                 'shuffle',
57
-                function (array $array) {
57
+                function(array $array) {
58 58
                     shuffle($array);
59 59
 
60 60
                     return $array;
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             ),
63 63
             new \Twig_SimpleFilter(
64 64
                 'ksort',
65
-                function (array $array) {
65
+                function(array $array) {
66 66
                     ksort($array);
67 67
 
68 68
                     return $array;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             ),
71 71
             new \Twig_SimpleFilter(
72 72
                 'krsort',
73
-                function (array $array) {
73
+                function(array $array) {
74 74
                     krsort($array);
75 75
 
76 76
                     return $array;
Please login to merge, or discard this patch.
src/View/Helper/HtmlHelper.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -101,19 +101,19 @@  discard block
 block discarded – undo
101 101
         $html = '';
102 102
 
103 103
         // description
104
-        $description = (string)$this->getMeta($data, 'description', '');
104
+        $description = (string) $this->getMeta($data, 'description', '');
105 105
         $html .= $this->metaDescription($description);
106 106
 
107 107
         // author
108
-        $author = (string)$this->getMeta($data, 'author', '');
108
+        $author = (string) $this->getMeta($data, 'author', '');
109 109
         $html .= $this->metaAuthor($author);
110 110
 
111 111
         // css
112
-        $docType = (string)$this->getMeta($data, 'docType', 'xhtml-strict');
112
+        $docType = (string) $this->getMeta($data, 'docType', 'xhtml-strict');
113 113
         $html .= $this->metaCss($docType);
114 114
 
115 115
         // generator
116
-        $project = (array)$this->getMeta($data, 'project', []);
116
+        $project = (array) $this->getMeta($data, 'project', []);
117 117
         $html .= $this->metaGenerator($project);
118 118
 
119 119
         // other data
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     public function metaAuthor(?string $creator): string
163 163
     {
164 164
         if (empty($creator)) {
165
-            $creator = (string)$this->getMeta([], 'author', '');
165
+            $creator = (string) $this->getMeta([], 'author', '');
166 166
             if (empty($creator)) {
167 167
                 return '';
168 168
             }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
     public function metaCss(string $docType): string
188 188
     {
189 189
         if ($docType === 'html5') {
190
-            $docType = (string)$this->getMeta([], 'docType', '');
190
+            $docType = (string) $this->getMeta([], 'docType', '');
191 191
             if (empty($docType)) {
192 192
                 return '';
193 193
             }
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
     public function metaGenerator(array $project): string
213 213
     {
214 214
         if (empty($project['name'])) {
215
-            $project = (array)$this->getMeta([], 'project', []);
215
+            $project = (array) $this->getMeta([], 'project', []);
216 216
             if (empty($project['name'])) {
217 217
                 return '';
218 218
             }
Please login to merge, or discard this patch.
src/Utility/AssetsRevisions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
             $path = CONFIG . 'rev-manifest.json';
42 42
         }
43 43
         if (file_exists($path)) {
44
-            static::$assets = (array)json_decode(file_get_contents($path), true);
44
+            static::$assets = (array) json_decode(file_get_contents($path), true);
45 45
         }
46 46
     }
47 47
 
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
         }
60 60
 
61 61
         if (!empty(static::$assets[$name])) {
62
-            return (string)static::$assets[$name];
62
+            return (string) static::$assets[$name];
63 63
         }
64 64
         if (!empty($extension) && !empty(static::$assets[$name . $extension])) {
65
-            return (string)static::$assets[$name . $extension];
65
+            return (string) static::$assets[$name . $extension];
66 66
         }
67 67
 
68 68
         return $name;
Please login to merge, or discard this patch.
src/Controller/ApiProxyTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         }
182 182
         $this->response = $this->response->withStatus($status);
183 183
         $errorData = [
184
-            'status' => (string)$status,
184
+            'status' => (string) $status,
185 185
             'title' => $error->getMessage(),
186 186
         ];
187 187
         $this->set('error', $errorData);
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             $response = $this->maskMultiLinks($response, 'meta.resources', 'href');
214 214
         }
215 215
 
216
-        $data = (array)Hash::get($response, 'data');
216
+        $data = (array) Hash::get($response, 'data');
217 217
         if (empty($data)) {
218 218
             return $response;
219 219
         }
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
             $response['data'] = $this->maskMultiLinks($data);
229 229
         }
230 230
 
231
-        return (array)$response;
231
+        return (array) $response;
232 232
     }
233 233
 
234 234
     /**
Please login to merge, or discard this patch.
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.