Passed
Push — master ( f38dde...147718 )
by Fran
02:30
created
src/base/types/helpers/DocumentorHelper.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
         ];
44 44
         if ($endpoint['payload']['is_array']) {
45 45
             $schema['items'] = [
46
-                '$ref' => '#/definitions/' . $endpoint['payload']['type'],
46
+                '$ref' => '#/definitions/'.$endpoint['payload']['type'],
47 47
             ];
48
-        } else {
49
-            $schema['$ref'] = '#/definitions/' . $endpoint['payload']['type'];
48
+        }else {
49
+            $schema['$ref'] = '#/definitions/'.$endpoint['payload']['type'];
50 50
         }
51 51
         if (!self::searchPayloadParam($paths[$url][$method]['parameters'], $endpoint['payload']['type'])) {
52 52
             $paths[$url][$method]['parameters'][] = [
@@ -77,13 +77,13 @@  discard block
 block discarded – undo
77 77
             if (array_key_exists('data', $endpoint['return']) && count(array_keys($object)) === count(array_keys($endpoint['return']['data']))) {
78 78
                 $classDefinition = [
79 79
                     'type' => 'object',
80
-                    '$ref' => '#/definitions/' . $class,
80
+                    '$ref' => '#/definitions/'.$class,
81 81
                 ];
82
-            } else {
82
+            }else {
83 83
                 $classDefinition = [
84 84
                     'type' => 'array',
85 85
                     'items' => [
86
-                        '$ref' => '#/definitions/' . $class,
86
+                        '$ref' => '#/definitions/'.$class,
87 87
                     ],
88 88
                 ];
89 89
             }
Please login to merge, or discard this patch.
src/base/types/helpers/ApiHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@
 block discarded – undo
152 152
     {
153 153
         if ($mappedColumn->getSize() > 100) {
154 154
             $fDto = self::createField($field, Field::TEXTAREA_TYPE, $required);
155
-        } else {
155
+        }else {
156 156
             $fDto = self::generateStringField($field, $required);
157 157
         }
158 158
         return $fDto;
Please login to merge, or discard this patch.
src/base/types/helpers/RequestHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
                 if (!headers_sent()) {
46 46
                     // TODO include this headers in Template class output method
47 47
                     header('Access-Control-Allow-Credentials: true');
48
-                    header('Access-Control-Allow-Origin: ' . Request::getInstance()->getServer('HTTP_ORIGIN', '*'));
48
+                    header('Access-Control-Allow-Origin: '.Request::getInstance()->getServer('HTTP_ORIGIN', '*'));
49 49
                     header('Vary: Origin');
50 50
                     header('Access-Control-Allow-Methods: GET, POST, DELETE, PUT, PATCH, OPTIONS, HEAD');
51
-                    header('Access-Control-Allow-Headers: ' . implode(', ', self::getCorsHeaders()));
51
+                    header('Access-Control-Allow-Headers: '.implode(', ', self::getCorsHeaders()));
52 52
                 }
53 53
                 if (Request::getInstance()->getMethod() === Request::VERB_OPTIONS) {
54 54
                     Logger::log('Returning OPTIONS header confirmation for CORS pre flight requests', LOG_DEBUG);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
                         return $ip;
79 79
                     }
80 80
                 }
81
-            } else {
81
+            }else {
82 82
                 if (self::validateIpAddress($_SERVER['HTTP_X_FORWARDED_FOR'])) {
83 83
                     return $_SERVER['HTTP_X_FORWARDED_FOR'];
84 84
                 }
Please login to merge, or discard this patch.
src/services/AdminServices.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $platform = trim(Config::getInstance()->get('platform.name'));
35 35
         header('HTTP/1.1 401 Unauthorized');
36
-        header('WWW-Authenticate: Basic Realm="' . $platform . '"');
36
+        header('WWW-Authenticate: Basic Realm="'.$platform.'"');
37 37
         echo t('Zona restringida');
38 38
         exit();
39 39
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
                             $admin['class'] = 'primary';
76 76
                             break;
77 77
                     }
78
-                } else {
78
+                }else {
79 79
                     $admin['class'] = 'primary';
80 80
                 }
81 81
             }
Please login to merge, or discard this patch.
src/base/Template.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $dump = '';
121 121
         try {
122 122
             $dump = $this->tpl->render($tpl, $vars);
123
-        } catch (\Exception $e) {
123
+        }catch (\Exception $e) {
124 124
             Logger::log($e->getMessage(), LOG_ERR);
125 125
         }
126 126
         return $dump;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     public function regenerateTemplates()
148 148
     {
149 149
         $this->generateTemplatesCache();
150
-        $domains = Cache::getInstance()->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . 'domains.json', Cache::JSON, true);
150
+        $domains = Cache::getInstance()->getDataFromFile(CONFIG_DIR.DIRECTORY_SEPARATOR.'domains.json', Cache::JSON, true);
151 151
         $translations = [];
152 152
         if (is_array($domains)) {
153 153
             $translations = $this->parsePathTranslations($domains);
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
             // force compilation
173 173
             if ($file->isFile()) {
174 174
                 try {
175
-                    $this->tpl->load(str_replace($tplDir . '/', '', $file));
176
-                } catch (\Exception $e) {
175
+                    $this->tpl->load(str_replace($tplDir.'/', '', $file));
176
+                }catch (\Exception $e) {
177 177
                     Logger::log($e->getMessage(), LOG_ERR, ['file' => $e->getFile(), 'line' => $e->getLine()]);
178 178
                 }
179 179
             }
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
      */
254 254
     private function loadDomains()
255 255
     {
256
-        $domains = Cache::getInstance()->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . 'domains.json', Cache::JSON, true);
256
+        $domains = Cache::getInstance()->getDataFromFile(CONFIG_DIR.DIRECTORY_SEPARATOR.'domains.json', Cache::JSON, true);
257 257
         if (null !== $domains) {
258 258
             foreach ($domains as $domain => $paths) {
259 259
                 $this->addPath($paths['template'], preg_replace('/(@|\/)/', '', $domain));
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
     {
269 269
         $loader = new FilesystemLoader(GeneratorHelper::getTemplatePath());
270 270
         $this->tpl = new Environment($loader, array(
271
-            'cache' => CACHE_DIR . DIRECTORY_SEPARATOR . 'twig',
271
+            'cache' => CACHE_DIR.DIRECTORY_SEPARATOR.'twig',
272 272
             'debug' => (bool)$this->debug,
273 273
             'auto_reload' => Config::getParam('twig.autoreload', TRUE),
274 274
         ));
Please login to merge, or discard this patch.
src/base/Router.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function init()
82 82
     {
83
-        list($this->routing, $this->slugs) = $this->cache->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . 'urls.json', $this->cacheType, TRUE);
84
-        $this->domains = $this->cache->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . 'domains.json', $this->cacheType, TRUE);
83
+        list($this->routing, $this->slugs) = $this->cache->getDataFromFile(CONFIG_DIR.DIRECTORY_SEPARATOR.'urls.json', $this->cacheType, TRUE);
84
+        $this->domains = $this->cache->getDataFromFile(CONFIG_DIR.DIRECTORY_SEPARATOR.'domains.json', $this->cacheType, TRUE);
85 85
         if (empty($this->routing) || Config::getParam('debug', true)) {
86 86
             $this->debugLoad();
87 87
         }
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
         }
124 124
 
125 125
         $notFoundRoute = Config::getParam('route.404');
126
-        if(null !== $notFoundRoute) {
126
+        if (null !== $notFoundRoute) {
127 127
             Request::getInstance()->redirect($this->getRoute($notFoundRoute, true));
128
-        } else {
128
+        }else {
129 129
             return $template->render('error.html.twig', array(
130 130
                 'exception' => $exception,
131 131
                 'trace' => $exception->getTraceAsString(),
@@ -176,12 +176,12 @@  discard block
 block discarded – undo
176 176
         try {
177 177
             //Search action and execute
178 178
             return $this->searchAction($route);
179
-        } catch (AccessDeniedException $e) {
180
-            Logger::log(t('Solicitamos credenciales de acceso a zona restringida'), LOG_WARNING, ['file' => $e->getFile() . '[' . $e->getLine() . ']']);
179
+        }catch (AccessDeniedException $e) {
180
+            Logger::log(t('Solicitamos credenciales de acceso a zona restringida'), LOG_WARNING, ['file' => $e->getFile().'['.$e->getLine().']']);
181 181
             return Admin::staticAdminLogon($route);
182
-        } catch (RouterException $r) {
182
+        }catch (RouterException $r) {
183 183
             Logger::log($r->getMessage(), LOG_WARNING);
184
-        } catch (Exception $e) {
184
+        }catch (Exception $e) {
185 185
             Logger::log($e->getMessage(), LOG_ERR);
186 186
             throw $e;
187 187
         }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
      */
200 200
     protected function searchAction($route)
201 201
     {
202
-        Inspector::stats('[Router] Searching action to execute: ' . $route, Inspector::SCOPE_DEBUG);
202
+        Inspector::stats('[Router] Searching action to execute: '.$route, Inspector::SCOPE_DEBUG);
203 203
         //Revisamos si tenemos la ruta registrada
204 204
         $parts = parse_url($route);
205 205
         $path = array_key_exists('path', $parts) ? $parts['path'] : $route;
@@ -214,12 +214,12 @@  discard block
 block discarded – undo
214 214
                 /** @var $class Controller */
215 215
                 $class = RouterHelper::getClassToCall($action);
216 216
                 try {
217
-                    if($this->checkRequirements($action, $get)) {
217
+                    if ($this->checkRequirements($action, $get)) {
218 218
                         return $this->executeCachedRoute($route, $action, $class, $get);
219
-                    } else {
219
+                    }else {
220 220
                         throw new RouterException(t('La ruta no es válida'), 400);
221 221
                     }
222
-                } catch (Exception $e) {
222
+                }catch (Exception $e) {
223 223
                     Logger::log($e->getMessage(), LOG_ERR);
224 224
                     throw $e;
225 225
                 }
@@ -235,15 +235,15 @@  discard block
 block discarded – undo
235 235
      */
236 236
     private function checkRequirements(array $action, $params = []) {
237 237
         Inspector::stats('[Router] Checking request requirements', Inspector::SCOPE_DEBUG);
238
-        if(!empty($params) && !empty($action['requirements'])) {
238
+        if (!empty($params) && !empty($action['requirements'])) {
239 239
             $checked = 0;
240
-            foreach(array_keys($params) as $key) {
241
-                if(in_array($key, $action['requirements'], true)) {
240
+            foreach (array_keys($params) as $key) {
241
+                if (in_array($key, $action['requirements'], true)) {
242 242
                     $checked++;
243 243
                 }
244 244
             }
245 245
             $valid = count($action['requirements']) === $checked;
246
-        } else {
246
+        }else {
247 247
             $valid = true;
248 248
         }
249 249
         return $valid;
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
         $externalModules = $this->getExternalModules();
267 267
         $externalModules = explode(',', $externalModules);
268 268
         foreach ($externalModules as $module) {
269
-            if(strlen($module)) {
269
+            if (strlen($module)) {
270 270
                 $this->loadExternalModule($hydrateRoute, $module);
271 271
             }
272 272
         }
@@ -286,14 +286,14 @@  discard block
 block discarded – undo
286 286
         $this->checkExternalModules();
287 287
         if (file_exists($modulesPath)) {
288 288
             $modules = $this->finder->directories()->in($modulesPath)->depth(0);
289
-            if($modules->hasResults()) {
289
+            if ($modules->hasResults()) {
290 290
                 foreach ($modules->getIterator() as $modulePath) {
291 291
                     $module = $modulePath->getBasename();
292
-                    $this->routing = $this->inspectDir($modulesPath . DIRECTORY_SEPARATOR . $module, $module, $this->routing);
292
+                    $this->routing = $this->inspectDir($modulesPath.DIRECTORY_SEPARATOR.$module, $module, $this->routing);
293 293
                 }
294 294
             }
295 295
         }
296
-        $this->cache->storeData(CONFIG_DIR . DIRECTORY_SEPARATOR . 'domains.json', $this->domains, Cache::JSON, TRUE);
296
+        $this->cache->storeData(CONFIG_DIR.DIRECTORY_SEPARATOR.'domains.json', $this->domains, Cache::JSON, TRUE);
297 297
     }
298 298
 
299 299
     /**
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
             $homeParams = NULL;
311 311
             foreach ($this->routing as $pattern => $params) {
312 312
                 list($method, $route) = RouterHelper::extractHttpRoute($pattern);
313
-                if (preg_match('/' . preg_quote($route, '/') . '$/i', '/' . $home)) {
313
+                if (preg_match('/'.preg_quote($route, '/').'$/i', '/'.$home)) {
314 314
                     $homeParams = $params;
315 315
                 }
316 316
                 unset($method);
@@ -333,14 +333,14 @@  discard block
 block discarded – undo
333 333
     private function inspectDir($origen, $namespace = 'PSFS', $routing = [])
334 334
     {
335 335
         $files = $this->finder->files()->in($origen)->path('/(controller|api)/i')->depth('< 3')->name('*.php');
336
-        if($files->hasResults()) {
336
+        if ($files->hasResults()) {
337 337
             foreach ($files->getIterator() as $file) {
338
-                if($namespace !== 'PSFS' && method_exists($file, 'getRelativePathname')) {
339
-                    $filename = '\\' . str_replace('/', '\\', str_replace($origen, '', $file->getRelativePathname()));
340
-                } else {
338
+                if ($namespace !== 'PSFS' && method_exists($file, 'getRelativePathname')) {
339
+                    $filename = '\\'.str_replace('/', '\\', str_replace($origen, '', $file->getRelativePathname()));
340
+                }else {
341 341
                     $filename = str_replace('/', '\\', str_replace($origen, '', $file->getPathname()));
342 342
                 }
343
-                $routing = $this->addRouting($namespace . str_replace('.php', '', $filename), $routing, $namespace);
343
+                $routing = $this->addRouting($namespace.str_replace('.php', '', $filename), $routing, $namespace);
344 344
             }
345 345
         }
346 346
         $this->finder = new Finder();
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
     private function addRouting($namespace, &$routing, $module = 'PSFS')
368 368
     {
369 369
         if (self::exists($namespace)) {
370
-            if(I18nHelper::checkI18Class($namespace)) {
370
+            if (I18nHelper::checkI18Class($namespace)) {
371 371
                 return $routing;
372 372
             }
373 373
             $reflection = new ReflectionClass($namespace);
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
             if (!$this->domains) {
407 407
                 $this->domains = [];
408 408
             }
409
-            $domain = '@' . $class->getConstant('DOMAIN') . '/';
409
+            $domain = '@'.$class->getConstant('DOMAIN').'/';
410 410
             if (!array_key_exists($domain, $this->domains)) {
411 411
                 $this->domains[$domain] = RouterHelper::extractDomainInfo($class, $domain);
412 412
             }
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
     {
424 424
         $this->generateSlugs();
425 425
         GeneratorHelper::createDir(CONFIG_DIR);
426
-        Cache::getInstance()->storeData(CONFIG_DIR . DIRECTORY_SEPARATOR . 'urls.json', array($this->routing, $this->slugs), Cache::JSON, TRUE);
426
+        Cache::getInstance()->storeData(CONFIG_DIR.DIRECTORY_SEPARATOR.'urls.json', array($this->routing, $this->slugs), Cache::JSON, TRUE);
427 427
 
428 428
         return $this;
429 429
     }
@@ -440,18 +440,18 @@  discard block
 block discarded – undo
440 440
     {
441 441
         $baseUrl = $absolute ? Request::getInstance()->getRootUrl() : '';
442 442
         if ('' === $slug) {
443
-            return $baseUrl . '/';
443
+            return $baseUrl.'/';
444 444
         }
445 445
         if (!is_array($this->slugs) || !array_key_exists($slug, $this->slugs)) {
446 446
             throw new RouterException(t('No existe la ruta especificada'));
447 447
         }
448
-        $url = $baseUrl . $this->slugs[$slug];
448
+        $url = $baseUrl.$this->slugs[$slug];
449 449
         if (!empty($params)) {
450 450
             foreach ($params as $key => $value) {
451
-                $url = str_replace('{' . $key . '}', $value, $url);
451
+                $url = str_replace('{'.$key.'}', $value, $url);
452 452
             }
453 453
         } elseif (!empty($this->routing[$this->slugs[$slug]]['default'])) {
454
-            $url = $baseUrl . $this->routing[$this->slugs[$slug]]['default'];
454
+            $url = $baseUrl.$this->routing[$this->slugs[$slug]]['default'];
455 455
         }
456 456
 
457 457
         return preg_replace('/(GET|POST|PUT|DELETE|ALL|HEAD|PATCH)\#\|\#/', '', $url);
@@ -470,15 +470,15 @@  discard block
 block discarded – undo
470 470
      * @param string $method
471 471
      */
472 472
     private function checkPreActions($class, $method) {
473
-        $preAction = 'pre' . ucfirst($method);
474
-        if(method_exists($class, $preAction)) {
473
+        $preAction = 'pre'.ucfirst($method);
474
+        if (method_exists($class, $preAction)) {
475 475
             Inspector::stats('[Router] Pre action invoked', Inspector::SCOPE_DEBUG);
476 476
             try {
477
-                if(false === call_user_func_array([$class, $preAction])) {
477
+                if (false === call_user_func_array([$class, $preAction])) {
478 478
                     Logger::log(t('Pre action failed'), LOG_ERR, [error_get_last()]);
479 479
                     error_clear_last();
480 480
                 }
481
-            } catch (Exception $e) {
481
+            }catch (Exception $e) {
482 482
                 Logger::log($e->getMessage(), LOG_ERR, [$class, $method]);
483 483
             }
484 484
         }
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
      */
496 496
     protected function executeCachedRoute($route, $action, $class, $params = NULL)
497 497
     {
498
-        Inspector::stats('[Router] Executing route ' . $route, Inspector::SCOPE_DEBUG);
498
+        Inspector::stats('[Router] Executing route '.$route, Inspector::SCOPE_DEBUG);
499 499
         $action['params'] = array_merge($action['params'], $params, Request::getInstance()->getQueryParams());
500 500
         Security::getInstance()->setSessionKey(Cache::CACHE_SESSION_VAR, $action);
501 501
         $cache = Cache::needCache();
@@ -503,15 +503,15 @@  discard block
 block discarded – undo
503 503
         $return = null;
504 504
         if (FALSE !== $cache && $action['http'] === 'GET' && Config::getParam('debug') === FALSE) {
505 505
             list($path, $cacheDataName) = $this->cache->getRequestCacheHash();
506
-            $cachedData = $this->cache->readFromCache('json' . DIRECTORY_SEPARATOR . $path . $cacheDataName, $cache);
506
+            $cachedData = $this->cache->readFromCache('json'.DIRECTORY_SEPARATOR.$path.$cacheDataName, $cache);
507 507
             if (NULL !== $cachedData) {
508
-                $headers = $this->cache->readFromCache('json' . DIRECTORY_SEPARATOR . $path . $cacheDataName . '.headers', $cache, null, Cache::JSON);
508
+                $headers = $this->cache->readFromCache('json'.DIRECTORY_SEPARATOR.$path.$cacheDataName.'.headers', $cache, null, Cache::JSON);
509 509
                 Template::getInstance()->renderCache($cachedData, $headers);
510 510
                 $execute = FALSE;
511 511
             }
512 512
         }
513 513
         if ($execute) {
514
-            Inspector::stats('[Router] Start executing action ' . $route, Inspector::SCOPE_DEBUG);
514
+            Inspector::stats('[Router] Start executing action '.$route, Inspector::SCOPE_DEBUG);
515 515
             $this->checkPreActions($class, $action['method']);
516 516
             $return = call_user_func_array([$class, $action['method']], $params);
517 517
             if (false === $return) {
@@ -545,11 +545,11 @@  discard block
 block discarded – undo
545 545
     private function loadExternalAutoloader($hydrateRoute, SplFileInfo $modulePath, $externalModulePath)
546 546
     {
547 547
         $extModule = $modulePath->getBasename();
548
-        $moduleAutoloader = realpath($externalModulePath . DIRECTORY_SEPARATOR . $extModule . DIRECTORY_SEPARATOR . 'autoload.php');
549
-        if(file_exists($moduleAutoloader)) {
548
+        $moduleAutoloader = realpath($externalModulePath.DIRECTORY_SEPARATOR.$extModule.DIRECTORY_SEPARATOR.'autoload.php');
549
+        if (file_exists($moduleAutoloader)) {
550 550
             include_once $moduleAutoloader;
551 551
             if ($hydrateRoute) {
552
-                $this->routing = $this->inspectDir($externalModulePath . DIRECTORY_SEPARATOR . $extModule, '\\' . $extModule, $this->routing);
552
+                $this->routing = $this->inspectDir($externalModulePath.DIRECTORY_SEPARATOR.$extModule, '\\'.$extModule, $this->routing);
553 553
             }
554 554
         }
555 555
     }
@@ -563,16 +563,16 @@  discard block
 block discarded – undo
563 563
     {
564 564
         try {
565 565
             $module = preg_replace('/(\\\|\/)/', DIRECTORY_SEPARATOR, $module);
566
-            $externalModulePath = VENDOR_DIR . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . 'src';
567
-            if(file_exists($externalModulePath)) {
566
+            $externalModulePath = VENDOR_DIR.DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.'src';
567
+            if (file_exists($externalModulePath)) {
568 568
                 $externalModule = $this->finder->directories()->in($externalModulePath)->depth(0);
569
-                if($externalModule->hasResults()) {
569
+                if ($externalModule->hasResults()) {
570 570
                     foreach ($externalModule->getIterator() as $modulePath) {
571 571
                         $this->loadExternalAutoloader($hydrateRoute, $modulePath, $externalModulePath);
572 572
                     }
573 573
                 }
574 574
             }
575
-        } catch (Exception $e) {
575
+        }catch (Exception $e) {
576 576
             Logger::log($e->getMessage(), LOG_WARNING);
577 577
         }
578 578
     }
Please login to merge, or discard this patch.
src/base/extension/traits/JsTrait.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
             foreach ($compiledFiles as $file) {
26 26
                 echo "\t\t<script type='text/javascript' src='{$file}'></script>\n";
27 27
             }
28
-        } else {
29
-            echo "\t\t<script type='text/javascript' src='" . $baseUrl . "/js/" . $hash . ".js'></script>\n";
28
+        }else {
29
+            echo "\t\t<script type='text/javascript' src='".$baseUrl."/js/".$hash.".js'></script>\n";
30 30
         }
31 31
     }
32 32
 
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
      */
40 40
     protected function putDebugJs($pathParts, $base, $file)
41 41
     {
42
-        $filePath = $this->hash . "_" . $pathParts[count($pathParts) - 1];
43
-        $this->compiled_files[] = "/js/" . $filePath;
42
+        $filePath = $this->hash."_".$pathParts[count($pathParts) - 1];
43
+        $this->compiled_files[] = "/js/".$filePath;
44 44
         $data = "";
45
-        if (!file_exists($base . $filePath) || filemtime($base . $filePath) < filemtime($file)) {
45
+        if (!file_exists($base.$filePath) || filemtime($base.$filePath) < filemtime($file)) {
46 46
             $data = file_get_contents($file);
47
-            $this->storeContents($base . $filePath, $data);
47
+            $this->storeContents($base.$filePath, $data);
48 48
         }
49 49
         return $data;
50 50
     }
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     {
60 60
         GeneratorHelper::createDir(dirname($path));
61 61
         if ("" !== $content && false === file_put_contents($path, $content)) {
62
-            throw new ConfigException(t('No se tienen permisos para escribir en ' . $path));
62
+            throw new ConfigException(t('No se tienen permisos para escribir en '.$path));
63 63
         }
64 64
     }
65 65
 
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
      */
71 71
     protected function compileJs(array $files, $basePath, $hash, $debug = false)
72 72
     {
73
-        $base = $basePath . "js" . DIRECTORY_SEPARATOR;
74
-        if ($debug || !file_exists($base . $hash . ".js")) {
73
+        $base = $basePath."js".DIRECTORY_SEPARATOR;
74
+        if ($debug || !file_exists($base.$hash.".js")) {
75 75
             $data = '';
76 76
             if (0 < count($files)) {
77 77
                 $minifier = new JS();
@@ -80,22 +80,22 @@  discard block
 block discarded – undo
80 80
                     if (file_exists($file)) {
81 81
                         if ($debug) {
82 82
                             $data = $this->putDebugJs($pathParts, $base, $file);
83
-                        } elseif (!file_exists($base . $hash . ".js")) {
83
+                        } elseif (!file_exists($base.$hash.".js")) {
84 84
                             $minifier->add($file);
85 85
                             //$data = $this->putProductionJs($base, $file, $data);
86 86
                         }
87 87
                     }
88 88
                 }
89
-                if($debug) {
90
-                    $this->storeContents($base . $hash . ".js", $data);
91
-                } else {
89
+                if ($debug) {
90
+                    $this->storeContents($base.$hash.".js", $data);
91
+                }else {
92 92
                     ini_set('max_execution_time', -1);
93 93
                     ini_set('memory_limit', -1);
94 94
                     GeneratorHelper::createDir($base);
95
-                    if(Config::getParam('assets.obfuscate', false)) {
96
-                        $minifier->gzip($base . $hash . ".js");
97
-                    } else {
98
-                        $minifier->minify($base . $hash . ".js");
95
+                    if (Config::getParam('assets.obfuscate', false)) {
96
+                        $minifier->gzip($base.$hash.".js");
97
+                    }else {
98
+                        $minifier->minify($base.$hash.".js");
99 99
                     }
100 100
                 }
101 101
                 unset($minifier);
Please login to merge, or discard this patch.
src/base/extension/traits/CssTrait.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
      */
27 27
     protected function compileCss($basePath, $hash, $debug = false)
28 28
     {
29
-        $base = $basePath . "css" . DIRECTORY_SEPARATOR;
30
-        if ($debug || !file_exists($base . $hash . ".css")) {
29
+        $base = $basePath."css".DIRECTORY_SEPARATOR;
30
+        if ($debug || !file_exists($base.$hash.".css")) {
31 31
             $data = '';
32 32
             if (0 < count($this->files)) {
33 33
                 $minifier = new CSS();
@@ -35,15 +35,15 @@  discard block
 block discarded – undo
35 35
                     $data = $this->processCssLine($file, $base, $data);
36 36
                 }
37 37
             }
38
-            if($debug) {
39
-                $this->storeContents($base . $hash . ".css", $data);
40
-            } else {
38
+            if ($debug) {
39
+                $this->storeContents($base.$hash.".css", $data);
40
+            }else {
41 41
                 $minifier = new CSS();
42 42
                 $minifier->add($data);
43 43
                 ini_set('max_execution_time', -1);
44 44
                 ini_set('memory_limit', -1);
45 45
                 GeneratorHelper::createDir($base);
46
-                $minifier->minify($base . $hash . ".css");
46
+                $minifier->minify($base.$hash.".css");
47 47
             }
48 48
             unset($minifier);
49 49
         }
@@ -62,21 +62,21 @@  discard block
 block discarded – undo
62 62
     {
63 63
         if (file_exists($file)) {
64 64
             $pathParts = explode("/", $file);
65
-            $filePath = $this->hash . "_" . $pathParts[count($pathParts) - 1];
66
-            if (!file_exists($base . $filePath) || filemtime($base . $filePath) < filemtime($file) || $this->debug) {
65
+            $filePath = $this->hash."_".$pathParts[count($pathParts) - 1];
66
+            if (!file_exists($base.$filePath) || filemtime($base.$filePath) < filemtime($file) || $this->debug) {
67 67
                 //Si tenemos modificaciones tenemos que compilar de nuevo todos los ficheros modificados
68
-                if (file_exists($base . $this->hash . ".css") && @unlink($base . $this->hash . ".css") === false) {
69
-                    throw new ConfigException("Can't unlink file " . $base . $this->hash . ".css");
68
+                if (file_exists($base.$this->hash.".css") && @unlink($base.$this->hash.".css") === false) {
69
+                    throw new ConfigException("Can't unlink file ".$base.$this->hash.".css");
70 70
                 }
71 71
                 $this->loopCssLines($file);
72 72
             }
73 73
             if ($this->debug) {
74 74
                 $data = file_get_contents($file);
75
-                $this->storeContents($base . $filePath, $data);
76
-            } else {
75
+                $this->storeContents($base.$filePath, $data);
76
+            }else {
77 77
                 $data .= file_get_contents($file);
78 78
             }
79
-            $this->compiled_files[] = "/css/" . $filePath;
79
+            $this->compiled_files[] = "/css/".$filePath;
80 80
         }
81 81
 
82 82
         return $data;
@@ -109,20 +109,20 @@  discard block
 block discarded – undo
109 109
     protected function extractCssResources($source, $file)
110 110
     {
111 111
         $sourceFile = AssetsHelper::extractSourceFilename($source);
112
-        $orig = realpath(dirname($file) . DIRECTORY_SEPARATOR . $sourceFile);
112
+        $orig = realpath(dirname($file).DIRECTORY_SEPARATOR.$sourceFile);
113 113
         $origPart = preg_split('/(\/|\\\)public(\/|\\\)/i', $orig);
114 114
         try {
115 115
             if (count($source) > 1 && array_key_exists(1, $origPart)) {
116
-                $dest = $this->path . $origPart[1];
116
+                $dest = $this->path.$origPart[1];
117 117
                 GeneratorHelper::createDir(dirname($dest));
118 118
                 if (!file_exists($dest) || filemtime($orig) > filemtime($dest)) {
119 119
                     if (@copy($orig, $dest) === FALSE) {
120
-                        throw new \RuntimeException('Can\' copy ' . $dest . '');
120
+                        throw new \RuntimeException('Can\' copy '.$dest.'');
121 121
                     }
122 122
                     Logger::log("$orig copiado a $dest", LOG_INFO);
123 123
                 }
124 124
             }
125
-        } catch (\Exception $e) {
125
+        }catch (\Exception $e) {
126 126
             Logger::log($e->getMessage(), LOG_ERR);
127 127
         }
128 128
     }
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
             foreach ($compiledFiles as $file) {
140 140
                 echo "\t\t<link href='{$file}' rel='stylesheet' media='screen, print'>";
141 141
             }
142
-        } else {
143
-            echo "\t\t<link href='" . $baseUrl . "/css/" . $hash . ".css' rel='stylesheet'>";
142
+        }else {
143
+            echo "\t\t<link href='".$baseUrl."/css/".$hash.".css' rel='stylesheet'>";
144 144
         }
145 145
     }
146 146
 }
Please login to merge, or discard this patch.
src/base/extension/AssetsParser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     public function __construct($type = 'js')
56 56
     {
57 57
         $this->type = $type;
58
-        $this->path = WEB_DIR . DIRECTORY_SEPARATOR;
58
+        $this->path = WEB_DIR.DIRECTORY_SEPARATOR;
59 59
         $this->domains = Template::getDomains(true);
60 60
         $this->debug = Config::getParam('debug', true);
61 61
         $this->cdnPath = Config::getParam('resources.cdn.url', Request::getInstance()->getRootUrl());
@@ -69,12 +69,12 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function addFile($filename)
71 71
     {
72
-        if (file_exists($this->path . $filename) && preg_match('/\.' . $this->type . '$/i', $filename)) {
72
+        if (file_exists($this->path.$filename) && preg_match('/\.'.$this->type.'$/i', $filename)) {
73 73
             $this->files[] = $filename;
74 74
         } elseif (!empty($this->domains)) {
75 75
             foreach ($this->domains as $domain => $paths) {
76 76
                 $domainFilename = str_replace($domain, $paths["public"], $filename);
77
-                if (file_exists($domainFilename) && preg_match('/\.' . $this->type . '$/i', $domainFilename)) {
77
+                if (file_exists($domainFilename) && preg_match('/\.'.$this->type.'$/i', $domainFilename)) {
78 78
                     $this->files[] = $domainFilename;
79 79
                 }
80 80
             }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     public function setHash($hash)
92 92
     {
93 93
         $cache = Config::getParam('cache.var', '');
94
-        $this->hash = $hash . (strlen($cache) ? '.' : '') . $cache;
94
+        $this->hash = $hash.(strlen($cache) ? '.' : '').$cache;
95 95
         return $this;
96 96
     }
97 97
 
Please login to merge, or discard this patch.