Passed
Push — master ( 3f7c6c...01af58 )
by Philippe
05:53
created
src/PageBuilder/UpdateSections.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     private function removeExistingSets()
92 92
     {
93 93
         foreach ($this->model->children() as $instance) {
94
-            if (! $instance instanceof StoredSetReference) {
94
+            if (!$instance instanceof StoredSetReference) {
95 95
                 continue;
96 96
             }
97 97
             $this->model->rejectChild($instance);
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         }
146 146
 
147 147
         foreach ($this->text_modules['replace'] as $text_module) {
148
-            if (! $module = FlatReferenceFactory::fromString($text_module['id'])->instance()) {
148
+            if (!$module = FlatReferenceFactory::fromString($text_module['id'])->instance()) {
149 149
                 continue;
150 150
             }
151 151
 
@@ -155,10 +155,10 @@  discard block
 block discarded – undo
155 155
                 continue;
156 156
             }
157 157
            
158
-            foreach($text_module['trans'] as $locale => $content)
158
+            foreach ($text_module['trans'] as $locale => $content)
159 159
             {
160 160
                 $purifier = new HTMLPurifier();
161
-                $sanitized_text = $purifier->purify( $content['content'] );
161
+                $sanitized_text = $purifier->purify($content['content']);
162 162
 
163 163
                 $text_module['trans'][$locale]['content'] = $sanitized_text;
164 164
             }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 
173 173
     private function removeTextualModule($module)
174 174
     {
175
-        if (! $module instanceof TextModule && ! $module instanceof PagetitleModule) {
175
+        if (!$module instanceof TextModule && !$module instanceof PagetitleModule) {
176 176
             throw new \Exception('Invalid request to remove non textual module');
177 177
         }
178 178
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
                 continue;
195 195
             }
196 196
 
197
-            $child = $children->first(function ($c) use ($reference) {
197
+            $child = $children->first(function($c) use ($reference) {
198 198
                 return $c->flatReference()->get() == $reference;
199 199
             });
200 200
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     private function stripTagsBlacklist($value, $blacklist = [])
246 246
     {
247 247
         foreach ($blacklist as $tag) {
248
-            $value = preg_replace('/<\/?' . $tag . '(.|\s)*?>/', '', $value);
248
+            $value = preg_replace('/<\/?'.$tag.'(.|\s)*?>/', '', $value);
249 249
         }
250 250
 
251 251
         return $value;
Please login to merge, or discard this patch.
src/Common/helpers.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $empty = true;
75 75
 
76 76
         foreach ($values as $value) {
77
-            if (! $value || !trim($value)) {
77
+            if (!$value || !trim($value)) {
78 78
                 continue;
79 79
             }
80 80
             $empty = false;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     }
85 85
 }
86 86
 
87
-if (! function_exists('contract')) {
87
+if (!function_exists('contract')) {
88 88
     function contract($instance, $contract)
89 89
     {
90 90
         return $instance instanceof $contract;
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             $text = cleanupHTML($text, $clean);
114 114
         }
115 115
         $teaser = substr($text, 0, $max);
116
-        return strlen($text) <= $max ? $teaser : $teaser . $ending;
116
+        return strlen($text) <= $max ? $teaser : $teaser.$ending;
117 117
     }
118 118
 }
119 119
 
@@ -166,13 +166,13 @@  discard block
 block discarded – undo
166 166
         }
167 167
         // // cleanup HTML and any unwanted attributes
168 168
         $purifier = new HTMLPurifier();
169
-        $value = $purifier->purify( $value );
169
+        $value = $purifier->purify($value);
170 170
 
171 171
         /**
172 172
          * htmlPurifier converts characters to their encode equivalents. This is something
173 173
          * that we need to reverse after the htmlPurifier cleanup.
174 174
          */
175
-        $value  = str_replace('&amp;', '&', $value);
175
+        $value = str_replace('&amp;', '&', $value);
176 176
 
177 177
         return $value;
178 178
     }
@@ -240,16 +240,16 @@  discard block
 block discarded – undo
240 240
             'scheme', 'host', 'port', 'path', 'query', 'fragment'
241 241
         ], null), $parsed_url, $overrides);
242 242
 
243
-        $scheme = $parsed_url['scheme'] ? $parsed_url['scheme'] . '://' : null;
244
-        $port = $parsed_url['port'] ? ':' . $parsed_url['port'] : null;
245
-        $fragment = $parsed_url['fragment'] ? '#' . $parsed_url['fragment'] : null;
243
+        $scheme = $parsed_url['scheme'] ? $parsed_url['scheme'].'://' : null;
244
+        $port = $parsed_url['port'] ? ':'.$parsed_url['port'] : null;
245
+        $fragment = $parsed_url['fragment'] ? '#'.$parsed_url['fragment'] : null;
246 246
 
247
-        $baseurl = $scheme . $parsed_url['host'] . $port . $parsed_url['path'];
247
+        $baseurl = $scheme.$parsed_url['host'].$port.$parsed_url['path'];
248 248
         $current_query = [];
249 249
 
250 250
         $_query = explode('&', $parsed_url['query']);
251 251
 
252
-        array_map(function ($v) use (&$current_query) {
252
+        array_map(function($v) use (&$current_query) {
253 253
             if (!$v) {
254 254
                 return;
255 255
             }
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 
268 268
         $query = urldecode(http_build_query(array_merge($current_query, $query_params)));
269 269
 
270
-        return $baseurl . '?' . $query . $fragment;
270
+        return $baseurl.'?'.$query.$fragment;
271 271
     }
272 272
 }
273 273
 
@@ -276,9 +276,9 @@  discard block
 block discarded – undo
276 276
     {
277 277
         $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
278 278
         if (php_sapi_name() == 'cli') {
279
-            print_r("\e[1;30m dumped at: " . str_replace(base_path(), '', $trace[0]['file']). ", line: " . $trace[0]['line'] . "\e[40m\n");
280
-        } else {
281
-            print_r("[dumped at: " . str_replace(base_path(), '', $trace[0]['file']). ", line: " . $trace[0]['line'] . "]\n");
279
+            print_r("\e[1;30m dumped at: ".str_replace(base_path(), '', $trace[0]['file']).", line: ".$trace[0]['line']."\e[40m\n");
280
+        }else {
281
+            print_r("[dumped at: ".str_replace(base_path(), '', $trace[0]['file']).", line: ".$trace[0]['line']."]\n");
282 282
         }
283 283
         return dd($var, ...$moreVars);
284 284
     }
Please login to merge, or discard this patch.