Passed
Push — master ( 1265b0...980196 )
by Fran
03:08
created
src/base/types/helpers/ResponseHelper.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
             Logger::log('Adding debug headers to render response');
77 77
             $vars["__DEBUG__"]["includes"] = get_included_files();
78 78
             $vars["__DEBUG__"]["trace"] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
79
-            header('X-PSFS-DEBUG-TS: ' . Dispatcher::getInstance()->getTs() . ' s');
80
-            header('X-PSFS-DEBUG-MEM: ' . Dispatcher::getInstance()->getMem('MBytes') . ' MBytes');
81
-            header('X-PSFS-DEBUG-FILES: ' . count(get_included_files()) . ' files opened');
79
+            header('X-PSFS-DEBUG-TS: '.Dispatcher::getInstance()->getTs().' s');
80
+            header('X-PSFS-DEBUG-MEM: '.Dispatcher::getInstance()->getMem('MBytes').' MBytes');
81
+            header('X-PSFS-DEBUG-FILES: '.count(get_included_files()).' files opened');
82 82
         }
83 83
 
84 84
         return $vars;
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     public static function httpNotFound(Exception $exception = NULL, $isJson = false)
95 95
     {
96
-        if(self::isTest()) {
96
+        if (self::isTest()) {
97 97
             return 404;
98 98
         }
99 99
         Inspector::stats('[Router] Throw not found exception', Inspector::SCOPE_DEBUG);
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
         }
109 109
 
110 110
         $notFoundRoute = Config::getParam('route.404');
111
-        if(null !== $notFoundRoute) {
111
+        if (null !== $notFoundRoute) {
112 112
             Request::getInstance()->redirect(Router::getInstance()->getRoute($notFoundRoute, true));
113
-        } else {
113
+        }else {
114 114
             return $template->render('error.html.twig', array(
115 115
                 'exception' => $exception,
116 116
                 'trace' => $exception->getTraceAsString(),
Please login to merge, or discard this patch.
src/base/types/helpers/RouterHelper.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
     {
25 25
         Inspector::stats('[RouterHelper] Getting class to call for executing the request action', Inspector::SCOPE_DEBUG);
26 26
         Logger::log('Getting class to call for executing the request action', LOG_DEBUG, $action);
27
-        $actionClass = class_exists($action['class']) ? $action['class'] : "\\" . $action['class'];
27
+        $actionClass = class_exists($action['class']) ? $action['class'] : "\\".$action['class'];
28 28
         $reflectionClass = new ReflectionClass($actionClass);
29 29
         if ($reflectionClass->hasMethod('getInstance')) {
30 30
             $class = $reflectionClass->getMethod('getInstance')->invoke(null, $action['method']);
31
-        } else {
31
+        }else {
32 32
             $class = new $actionClass;
33 33
         }
34 34
         return $class;
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     public static function extractComponents($route, $pattern)
63 63
     {
64 64
         Inspector::stats('[RouterHelper] Extracting parts for the request to execute', Inspector::SCOPE_DEBUG);
65
-        if(Config::getParam('allow.double.slashes', true)) {
65
+        if (Config::getParam('allow.double.slashes', true)) {
66 66
             $route = preg_replace("/\/\//", '/', $route);
67 67
         }
68 68
         $url = parse_url($route);
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $expr = preg_quote($expr, '/');
121 121
         $expr = str_replace('###', '(.*)', $expr);
122 122
         $expr2 = preg_replace('/\(\.\*\)$/', '', $expr);
123
-        $matched = preg_match('/^' . $expr . '\/?$/i', $path) || preg_match('/^' . $expr2 . '?$/i', $path);
123
+        $matched = preg_match('/^'.$expr.'\/?$/i', $path) || preg_match('/^'.$expr2.'?$/i', $path);
124 124
         return $matched;
125 125
     }
126 126
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public static function extractDomainInfo(ReflectionClass $class, $domain)
133 133
     {
134
-        $path = dirname($class->getFileName()) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR;
134
+        $path = dirname($class->getFileName()).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR;
135 135
         $templatesPath = 'templates';
136 136
         $publicPath = 'public';
137 137
         $modelsPath = 'models';
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
             $modelsPath = ucfirst($modelsPath);
142 142
         }
143 143
         if ($class->hasConstant('TPL')) {
144
-            $templatesPath .= DIRECTORY_SEPARATOR . $class->getConstant('TPL');
144
+            $templatesPath .= DIRECTORY_SEPARATOR.$class->getConstant('TPL');
145 145
         }
146 146
         return [
147 147
             'base' => $path,
148
-            'template' => $path . $templatesPath,
149
-            'model' => $path . $modelsPath,
150
-            'public' => $path . $publicPath,
148
+            'template' => $path.$templatesPath,
149
+            'model' => $path.$modelsPath,
150
+            'public' => $path.$publicPath,
151 151
         ];
152 152
     }
153 153
 
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
             foreach ($parameters as $param) {
169 169
                 if ($param->isOptional() && !is_array($param->getDefaultValue())) {
170 170
                     $params[$param->getName()] = $param->getDefaultValue();
171
-                    $default = str_replace('{' . $param->getName() . '}', $param->getDefaultValue(), $regex);
171
+                    $default = str_replace('{'.$param->getName().'}', $param->getDefaultValue(), $regex);
172 172
                 } elseif (!$param->isOptional()) {
173 173
                     $requirements[] = $param->getName();
174 174
                 }
175 175
             }
176
-        } else {
176
+        }else {
177 177
             $default = $regex;
178 178
         }
179 179
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
             $httpMethod = AnnotationHelper::extractReflectionHttpMethod($docComments);
204 204
             $icon = AnnotationHelper::extractDocIcon($docComments);
205 205
             $label = AnnotationHelper::extractReflectionLabel(str_replace('{__API__}', $api, $docComments));
206
-            $route = $httpMethod . "#|#" . $regex;
206
+            $route = $httpMethod."#|#".$regex;
207 207
             $route = preg_replace('/(\\r|\\f|\\t|\\n)/', '', $route);
208 208
             $info = [
209 209
                 'method' => $method->getName(),
Please login to merge, or discard this patch.
src/base/types/helpers/SecurityHelper.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             && (preg_match('/^\/(admin|setup\-admin)/i', $route) || Config::getParam('restricted', false))
35 35
         ) {
36 36
             if (!self::isTest() &&
37
-                null === Cache::getInstance()->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . 'admins.json', Cache::JSONGZ, true)) {
37
+                null === Cache::getInstance()->getDataFromFile(CONFIG_DIR.DIRECTORY_SEPARATOR.'admins.json', Cache::JSONGZ, true)) {
38 38
                 throw new AdminCredentialsException();
39 39
             }
40 40
             if (!Security::getInstance()->checkAdmin()) {
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
         $token = '';
55 55
         $length = strlen($timestamp);
56 56
         for ($i = 0; $i < $length; $i++) {
57
-            $token = substr($hash, $i, 1) .
58
-                substr($timestamp, $i, 1) .
57
+            $token = substr($hash, $i, 1).
58
+                substr($timestamp, $i, 1).
59 59
                 $token;
60 60
         }
61 61
         return $token;
@@ -74,16 +74,16 @@  discard block
 block discarded – undo
74 74
         $charsLength = strlen(self::RAND_SEP) - 1;
75 75
         $tsLength = strlen($timestamp);
76 76
         $i = 0;
77
-        $partCount = ceil($hashRest / 4);
78
-        $part = substr($hash, $tsLength + $partCount * $i, $partCount);
77
+        $partCount = ceil($hashRest/4);
78
+        $part = substr($hash, $tsLength + $partCount*$i, $partCount);
79 79
         while (false !== $part) {
80
-            $mixedToken .= $part .
81
-                substr(self::RAND_SEP, round(rand(0, $charsLength), 0, PHP_ROUND_HALF_DOWN), 1) .
80
+            $mixedToken .= $part.
81
+                substr(self::RAND_SEP, round(rand(0, $charsLength), 0, PHP_ROUND_HALF_DOWN), 1).
82 82
                 substr(self::RAND_SEP, round(rand(0, $charsLength), 0, PHP_ROUND_HALF_DOWN), 1);
83
-            $part = substr($hash, $tsLength + $partCount * $i, $partCount);
83
+            $part = substr($hash, $tsLength + $partCount*$i, $partCount);
84 84
             $i++;
85 85
         }
86
-        return $mixedToken . $token;
86
+        return $mixedToken.$token;
87 87
     }
88 88
 
89 89
     /**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     private static function getTs($isOdd = null)
94 94
     {
95 95
         $timestamp = time();
96
-        $tsIsOdd = (bool)((int)substr($timestamp, -1) % 2);
96
+        $tsIsOdd = (bool)((int)substr($timestamp, -1)%2);
97 97
         if (false === $isOdd && !$tsIsOdd) {
98 98
             $timestamp--;
99 99
         } elseif (true === $isOdd && !$tsIsOdd) {
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
         $timestamp = '';
131 131
         $part = strrev($part);
132 132
         for ($i = 0, $ct = strlen($part); $i < $ct; $i++) {
133
-            if ($i % 2 == 0) {
133
+            if ($i%2 == 0) {
134 134
                 $timestamp .= substr($part, $i, 1);
135
-            } else {
135
+            }else {
136 136
                 $partToken .= substr($part, $i, 1);
137 137
             }
138 138
         }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             foreach ($parts as $part) {
153 153
                 $token .= $part;
154 154
             }
155
-            $token = $partToken . $token;
155
+            $token = $partToken.$token;
156 156
         }
157 157
         return [$token, $timestamp];
158 158
     }
Please login to merge, or discard this patch.
src/base/Router.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function init()
64 64
     {
65
-        list($this->routing, $this->slugs) = $this->cache->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . 'urls.json', $this->cacheType, TRUE);
66
-        $this->domains = $this->cache->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . 'domains.json', $this->cacheType, TRUE);
65
+        list($this->routing, $this->slugs) = $this->cache->getDataFromFile(CONFIG_DIR.DIRECTORY_SEPARATOR.'urls.json', $this->cacheType, TRUE);
66
+        $this->domains = $this->cache->getDataFromFile(CONFIG_DIR.DIRECTORY_SEPARATOR.'domains.json', $this->cacheType, TRUE);
67 67
         if (empty($this->routing) || Config::getParam('debug', true)) {
68 68
             $this->debugLoad();
69 69
         }
@@ -98,13 +98,13 @@  discard block
 block discarded – undo
98 98
         try {
99 99
             //Search action and execute
100 100
             return $this->searchAction($route);
101
-        } catch (AccessDeniedException $e) {
102
-            Logger::log(t('Solicitamos credenciales de acceso a zona restringida'), LOG_WARNING, ['file' => $e->getFile() . '[' . $e->getLine() . ']']);
101
+        }catch (AccessDeniedException $e) {
102
+            Logger::log(t('Solicitamos credenciales de acceso a zona restringida'), LOG_WARNING, ['file' => $e->getFile().'['.$e->getLine().']']);
103 103
             return Admin::staticAdminLogon();
104
-        } catch (RouterException $r) {
104
+        }catch (RouterException $r) {
105 105
             Logger::log($r->getMessage(), LOG_WARNING);
106 106
             $code = $r->getCode();
107
-        } catch (Exception $e) {
107
+        }catch (Exception $e) {
108 108
             Logger::log($e->getMessage(), LOG_ERR);
109 109
             throw $e;
110 110
         }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      */
123 123
     protected function searchAction($route)
124 124
     {
125
-        Inspector::stats('[Router] Searching action to execute: ' . $route, Inspector::SCOPE_DEBUG);
125
+        Inspector::stats('[Router] Searching action to execute: '.$route, Inspector::SCOPE_DEBUG);
126 126
         //Revisamos si tenemos la ruta registrada
127 127
         $parts = parse_url($route);
128 128
         $path = array_key_exists('path', $parts) ? $parts['path'] : $route;
@@ -139,10 +139,10 @@  discard block
 block discarded – undo
139 139
                 try {
140 140
                     if ($this->checkRequirements($action, $get)) {
141 141
                         return $this->executeCachedRoute($route, $action, $class, $get);
142
-                    } else {
142
+                    }else {
143 143
                         throw new RouterException(t('Preconditions failed'), 412);
144 144
                     }
145
-                } catch (Exception $e) {
145
+                }catch (Exception $e) {
146 146
                     Logger::log($e->getMessage(), LOG_ERR);
147 147
                     throw $e;
148 148
                 }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
                 }
168 168
             }
169 169
             $valid = count($action['requirements']) === $checked;
170
-        } else {
170
+        }else {
171 171
             $valid = true;
172 172
         }
173 173
         return $valid;
@@ -190,11 +190,11 @@  discard block
 block discarded – undo
190 190
             if ($modules->hasResults()) {
191 191
                 foreach ($modules->getIterator() as $modulePath) {
192 192
                     $module = $modulePath->getBasename();
193
-                    $this->routing = $this->inspectDir($modulesPath . DIRECTORY_SEPARATOR . $module, $module, $this->routing);
193
+                    $this->routing = $this->inspectDir($modulesPath.DIRECTORY_SEPARATOR.$module, $module, $this->routing);
194 194
                 }
195 195
             }
196 196
         }
197
-        $this->cache->storeData(CONFIG_DIR . DIRECTORY_SEPARATOR . 'domains.json', $this->domains, Cache::JSON, TRUE);
197
+        $this->cache->storeData(CONFIG_DIR.DIRECTORY_SEPARATOR.'domains.json', $this->domains, Cache::JSON, TRUE);
198 198
     }
199 199
 
200 200
     /**
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
             $homeParams = NULL;
212 212
             foreach ($this->routing as $pattern => $params) {
213 213
                 list($method, $route) = RouterHelper::extractHttpRoute($pattern);
214
-                if (preg_match('/' . preg_quote($route, '/') . '$/i', '/' . $home)) {
214
+                if (preg_match('/'.preg_quote($route, '/').'$/i', '/'.$home)) {
215 215
                     $homeParams = $params;
216 216
                 }
217 217
                 unset($method);
@@ -243,18 +243,18 @@  discard block
 block discarded – undo
243 243
     {
244 244
         $baseUrl = $absolute ? Request::getInstance()->getRootUrl() : '';
245 245
         if ('' === $slug) {
246
-            return $baseUrl . '/';
246
+            return $baseUrl.'/';
247 247
         }
248 248
         if (!is_array($this->slugs) || !array_key_exists($slug, $this->slugs)) {
249 249
             throw new RouterException(t('No existe la ruta especificada'));
250 250
         }
251
-        $url = $baseUrl . $this->slugs[$slug];
251
+        $url = $baseUrl.$this->slugs[$slug];
252 252
         if (!empty($params)) {
253 253
             foreach ($params as $key => $value) {
254
-                $url = str_replace('{' . $key . '}', $value, $url);
254
+                $url = str_replace('{'.$key.'}', $value, $url);
255 255
             }
256 256
         } elseif (!empty($this->routing[$this->slugs[$slug]]['default'])) {
257
-            $url = $baseUrl . $this->routing[$this->slugs[$slug]]['default'];
257
+            $url = $baseUrl.$this->routing[$this->slugs[$slug]]['default'];
258 258
         }
259 259
 
260 260
         return preg_replace('/(GET|POST|PUT|DELETE|ALL|HEAD|PATCH)\#\|\#/', '', $url);
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
      */
267 267
     private function checkPreActions($class, $method)
268 268
     {
269
-        $preAction = 'pre' . ucfirst($method);
269
+        $preAction = 'pre'.ucfirst($method);
270 270
         if (method_exists($class, $preAction)) {
271 271
             Inspector::stats('[Router] Pre action invoked', Inspector::SCOPE_DEBUG);
272 272
             try {
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                     Logger::log(t('Pre action failed'), LOG_ERR, [error_get_last()]);
275 275
                     error_clear_last();
276 276
                 }
277
-            } catch (Exception $e) {
277
+            }catch (Exception $e) {
278 278
                 Logger::log($e->getMessage(), LOG_ERR, [$class, $method]);
279 279
             }
280 280
         }
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
      */
292 292
     protected function executeCachedRoute($route, $action, $class, $params = NULL)
293 293
     {
294
-        Inspector::stats('[Router] Executing route ' . $route, Inspector::SCOPE_DEBUG);
294
+        Inspector::stats('[Router] Executing route '.$route, Inspector::SCOPE_DEBUG);
295 295
         $action['params'] = array_merge($action['params'], $params, Request::getInstance()->getQueryParams());
296 296
         Security::getInstance()->setSessionKey(Cache::CACHE_SESSION_VAR, $action);
297 297
         $cache = Cache::needCache();
@@ -299,15 +299,15 @@  discard block
 block discarded – undo
299 299
         $return = null;
300 300
         if (FALSE !== $cache && $action['http'] === 'GET' && Config::getParam('debug') === FALSE) {
301 301
             list($path, $cacheDataName) = $this->cache->getRequestCacheHash();
302
-            $cachedData = $this->cache->readFromCache('json' . DIRECTORY_SEPARATOR . $path . $cacheDataName, $cache);
302
+            $cachedData = $this->cache->readFromCache('json'.DIRECTORY_SEPARATOR.$path.$cacheDataName, $cache);
303 303
             if (NULL !== $cachedData) {
304
-                $headers = $this->cache->readFromCache('json' . DIRECTORY_SEPARATOR . $path . $cacheDataName . '.headers', $cache, null, Cache::JSON);
304
+                $headers = $this->cache->readFromCache('json'.DIRECTORY_SEPARATOR.$path.$cacheDataName.'.headers', $cache, null, Cache::JSON);
305 305
                 Template::getInstance()->renderCache($cachedData, $headers);
306 306
                 $execute = FALSE;
307 307
             }
308 308
         }
309 309
         if ($execute) {
310
-            Inspector::stats('[Router] Start executing action ' . $route, Inspector::SCOPE_DEBUG);
310
+            Inspector::stats('[Router] Start executing action '.$route, Inspector::SCOPE_DEBUG);
311 311
             $this->checkPreActions($class, $action['method']);
312 312
             $return = call_user_func_array([$class, $action['method']], $params);
313 313
             if (false === $return) {
Please login to merge, or discard this patch.
src/base/types/traits/Router/SluggerTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
     {
51 51
         $this->generateSlugs();
52 52
         GeneratorHelper::createDir(CONFIG_DIR);
53
-        Cache::getInstance()->storeData(CONFIG_DIR . DIRECTORY_SEPARATOR . 'urls.json', [$this->routing, $this->getSlugs()], Cache::JSON, TRUE);
53
+        Cache::getInstance()->storeData(CONFIG_DIR.DIRECTORY_SEPARATOR.'urls.json', [$this->routing, $this->getSlugs()], Cache::JSON, TRUE);
54 54
 
55 55
         return $this;
56 56
     }
Please login to merge, or discard this patch.
src/base/types/traits/Router/ModulesTrait.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
         if ($files->hasResults()) {
55 55
             foreach ($files->getIterator() as $file) {
56 56
                 if ($namespace !== Router::PSFS_BASE_NAMESPACE && method_exists($file, 'getRelativePathname')) {
57
-                    $filename = '\\' . str_replace('/', '\\', str_replace($origen, '', $file->getRelativePathname()));
58
-                } else {
57
+                    $filename = '\\'.str_replace('/', '\\', str_replace($origen, '', $file->getRelativePathname()));
58
+                }else {
59 59
                     $filename = str_replace('/', '\\', str_replace($origen, '', $file->getPathname()));
60 60
                 }
61
-                $routing = $this->addRouting($namespace . str_replace('.php', '', $filename), $routing, $namespace);
61
+                $routing = $this->addRouting($namespace.str_replace('.php', '', $filename), $routing, $namespace);
62 62
             }
63 63
         }
64 64
         $this->initializeFinder();
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             if (!is_array($this->domains)) {
112 112
                 $this->domains = [];
113 113
             }
114
-            $domain = '@' . $class->getConstant('DOMAIN') . '/';
114
+            $domain = '@'.$class->getConstant('DOMAIN').'/';
115 115
             if (!array_key_exists($domain, $this->domains)) {
116 116
                 $this->domains[$domain] = RouterHelper::extractDomainInfo($class, $domain);
117 117
             }
@@ -138,11 +138,11 @@  discard block
 block discarded – undo
138 138
     private function loadExternalAutoloader($hydrateRoute, SplFileInfo $modulePath, $externalModulePath, &$routing = [])
139 139
     {
140 140
         $extModule = $modulePath->getBasename();
141
-        $moduleAutoloader = realpath($externalModulePath . DIRECTORY_SEPARATOR . $extModule . DIRECTORY_SEPARATOR . 'autoload.php');
141
+        $moduleAutoloader = realpath($externalModulePath.DIRECTORY_SEPARATOR.$extModule.DIRECTORY_SEPARATOR.'autoload.php');
142 142
         if (file_exists($moduleAutoloader)) {
143 143
             include_once $moduleAutoloader;
144 144
             if ($hydrateRoute) {
145
-                $routing = $this->inspectDir($externalModulePath . DIRECTORY_SEPARATOR . $extModule, '\\' . $extModule, $routing);
145
+                $routing = $this->inspectDir($externalModulePath.DIRECTORY_SEPARATOR.$extModule, '\\'.$extModule, $routing);
146 146
             }
147 147
         }
148 148
     }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     {
158 158
         try {
159 159
             $module = preg_replace('/(\\\|\/)/', DIRECTORY_SEPARATOR, $module);
160
-            $externalModulePath = VENDOR_DIR . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . 'src';
160
+            $externalModulePath = VENDOR_DIR.DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.'src';
161 161
             if (file_exists($externalModulePath)) {
162 162
                 $externalModule = $this->finder->directories()->in($externalModulePath)->depth(0);
163 163
                 if ($externalModule->hasResults()) {
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
                     }
167 167
                 }
168 168
             }
169
-        } catch (Exception $e) {
169
+        }catch (Exception $e) {
170 170
             Logger::log($e->getMessage(), LOG_WARNING);
171 171
         }
172 172
     }
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
     public function domainExists($domainToCheck) {
179 179
         $exists = false;
180 180
         $domains = array_keys($this->getDomains());
181
-        foreach($domains as $domain) {
181
+        foreach ($domains as $domain) {
182 182
             $cleanDomain = strtolower(str_replace(['@', '/', '\\'], '', $domain));
183
-            if($cleanDomain === strtolower($domainToCheck)) {
183
+            if ($cleanDomain === strtolower($domainToCheck)) {
184 184
                 $exists = true;
185 185
                 break;
186 186
             }
Please login to merge, or discard this patch.