Passed
Push — master ( 472f53...0ee5cf )
by Fran
02:53
created
src/services/GeneratorService.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -39,24 +39,24 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public static function findTranslations($path, $locale)
41 41
     {
42
-        $localePath = realpath(BASE_DIR . DIRECTORY_SEPARATOR . 'locale');
43
-        $localePath .= DIRECTORY_SEPARATOR . $locale . DIRECTORY_SEPARATOR . 'LC_MESSAGES' . DIRECTORY_SEPARATOR;
42
+        $localePath = realpath(BASE_DIR.DIRECTORY_SEPARATOR.'locale');
43
+        $localePath .= DIRECTORY_SEPARATOR.$locale.DIRECTORY_SEPARATOR.'LC_MESSAGES'.DIRECTORY_SEPARATOR;
44 44
 
45 45
         $translations = array();
46 46
         if (file_exists($path)) {
47 47
             $d = dir($path);
48 48
             while (false !== ($dir = $d->read())) {
49 49
                 GeneratorHelper::createDir($localePath);
50
-                if (!file_exists($localePath . 'translations.po')) {
51
-                    file_put_contents($localePath . 'translations.po', '');
50
+                if (!file_exists($localePath.'translations.po')) {
51
+                    file_put_contents($localePath.'translations.po', '');
52 52
                 }
53
-                $inspect_path = realpath($path . DIRECTORY_SEPARATOR . $dir);
54
-                $cmd_php = "export PATH=\$PATH:/opt/local/bin; xgettext " .
55
-                    $inspect_path . DIRECTORY_SEPARATOR .
53
+                $inspect_path = realpath($path.DIRECTORY_SEPARATOR.$dir);
54
+                $cmd_php = "export PATH=\$PATH:/opt/local/bin; xgettext ".
55
+                    $inspect_path.DIRECTORY_SEPARATOR.
56 56
                     "*.php --from-code=UTF-8 -j -L PHP --debug --force-po -o {$localePath}translations.po";
57
-                if (is_dir($path . DIRECTORY_SEPARATOR . $dir) && preg_match('/^\./', $dir) == 0) {
58
-                    $res = t('Revisando directorio: ') . $inspect_path;
59
-                    $res .= t('Comando ejecutado: ') . $cmd_php;
57
+                if (is_dir($path.DIRECTORY_SEPARATOR.$dir) && preg_match('/^\./', $dir) == 0) {
58
+                    $res = t('Revisando directorio: ').$inspect_path;
59
+                    $res .= t('Comando ejecutado: ').$cmd_php;
60 60
                     $res .= shell_exec($cmd_php);
61 61
                     usleep(10);
62 62
                     $translations[] = $res;
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function createStructureModule($module, $force = false, $type = "", $apiClass = "")
79 79
     {
80
-        $mod_path = CORE_DIR . DIRECTORY_SEPARATOR;
80
+        $mod_path = CORE_DIR.DIRECTORY_SEPARATOR;
81 81
         $module = ucfirst($module);
82 82
         $this->createModulePath($module, $mod_path);
83 83
         $this->createModulePathTree($module, $mod_path);
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         // Creates the src folder
99 99
         GeneratorHelper::createDir($mod_path);
100 100
         // Create module path
101
-        GeneratorHelper::createDir($mod_path . $module);
101
+        GeneratorHelper::createDir($mod_path.$module);
102 102
     }
103 103
 
104 104
     /**
@@ -113,16 +113,16 @@  discard block
 block discarded – undo
113 113
         $this->log->addLog("Generamos la estructura");
114 114
         $paths = [
115 115
             "Api", "Config", "Controller", "Models", "Public", "Templates", "Services", "Test", "Doc",
116
-            "Locale", "Locale/" . Config::getParam('default.locale', 'es_ES'), "Locale/" . Config::getParam('default.locale', 'es_ES') . "/LC_MESSAGES"
116
+            "Locale", "Locale/".Config::getParam('default.locale', 'es_ES'), "Locale/".Config::getParam('default.locale', 'es_ES')."/LC_MESSAGES"
117 117
         ];
118
-        $module_path = $mod_path . $module;
118
+        $module_path = $mod_path.$module;
119 119
         foreach ($paths as $path) {
120
-            GeneratorHelper::createDir($module_path . DIRECTORY_SEPARATOR . $path);
120
+            GeneratorHelper::createDir($module_path.DIRECTORY_SEPARATOR.$path);
121 121
         }
122 122
         //Creamos las carpetas de los assets
123 123
         $htmlPaths = array("css", "js", "img", "media", "font");
124 124
         foreach ($htmlPaths as $path) {
125
-            GeneratorHelper::createDir($module_path . DIRECTORY_SEPARATOR . "Public" . DIRECTORY_SEPARATOR . $path);
125
+            GeneratorHelper::createDir($module_path.DIRECTORY_SEPARATOR."Public".DIRECTORY_SEPARATOR.$path);
126 126
         }
127 127
     }
128 128
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      */
136 136
     private function createModuleBaseFiles($module, $mod_path, $force = false, $controllerType = '')
137 137
     {
138
-        $module_path = $mod_path . $module;
138
+        $module_path = $mod_path.$module;
139 139
         $this->generateControllerTemplate($module, $module_path, $force, $controllerType);
140 140
         $this->generateServiceTemplate($module, $module_path, $force);
141 141
         $this->genereateAutoloaderTemplate($module, $module_path, $force);
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
      */
154 154
     private function createModuleModels($module, $path)
155 155
     {
156
-        $module_path = $path . $module;
157
-        $module_path = str_replace(CORE_DIR . DIRECTORY_SEPARATOR, '', $module_path);
156
+        $module_path = $path.$module;
157
+        $module_path = str_replace(CORE_DIR.DIRECTORY_SEPARATOR, '', $module_path);
158 158
 
159 159
         $configGenerator = $this->getConfigGenerator($module_path);
160 160
 
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
         $configTemplate = $this->tpl->dump("generator/config.propel.template.twig", array(
165 165
             "module" => $module,
166 166
         ));
167
-        $this->writeTemplateToFile($configTemplate, CORE_DIR . DIRECTORY_SEPARATOR . $module_path . DIRECTORY_SEPARATOR . "Config" .
168
-            DIRECTORY_SEPARATOR . "config.php", true);
167
+        $this->writeTemplateToFile($configTemplate, CORE_DIR.DIRECTORY_SEPARATOR.$module_path.DIRECTORY_SEPARATOR."Config".
168
+            DIRECTORY_SEPARATOR."config.php", true);
169 169
         $this->log->addLog("Generado config genérico para propel");
170 170
     }
171 171
 
@@ -187,28 +187,28 @@  discard block
 block discarded – undo
187 187
             "namespace" => preg_replace('/(\\\|\/)/', '\\', $module),
188 188
             "url" => preg_replace('/(\\\|\/)/', '/', $module),
189 189
             "class" => $class,
190
-            "controllerType" => $class . "Base",
190
+            "controllerType" => $class."Base",
191 191
             "is_base" => false
192 192
         ));
193
-        $controller = $this->writeTemplateToFile($controllerBody, $mod_path . DIRECTORY_SEPARATOR . "Controller" .
194
-            DIRECTORY_SEPARATOR . "{$class}Controller.php", $force);
193
+        $controller = $this->writeTemplateToFile($controllerBody, $mod_path.DIRECTORY_SEPARATOR."Controller".
194
+            DIRECTORY_SEPARATOR."{$class}Controller.php", $force);
195 195
 
196 196
         $controllerBody = $this->tpl->dump("generator/controller.template.twig", array(
197 197
             "module" => $module,
198 198
             "namespace" => preg_replace('/(\\\|\/)/', '\\', $module),
199 199
             "url" => preg_replace('/(\\\|\/)/', '/', $module),
200
-            "class" => $class . "Base",
200
+            "class" => $class."Base",
201 201
             "service" => $class,
202 202
             "controllerType" => $controllerType,
203 203
             "is_base" => true,
204 204
             "domain" => $class,
205 205
         ));
206
-        $controllerBase = $this->writeTemplateToFile($controllerBody, $mod_path . DIRECTORY_SEPARATOR . "Controller" .
207
-            DIRECTORY_SEPARATOR . "base" . DIRECTORY_SEPARATOR . "{$class}BaseController.php", true);
206
+        $controllerBase = $this->writeTemplateToFile($controllerBody, $mod_path.DIRECTORY_SEPARATOR."Controller".
207
+            DIRECTORY_SEPARATOR."base".DIRECTORY_SEPARATOR."{$class}BaseController.php", true);
208 208
 
209
-        $filename = $mod_path . DIRECTORY_SEPARATOR . "Test" . DIRECTORY_SEPARATOR . "{$class}Test.php";
209
+        $filename = $mod_path.DIRECTORY_SEPARATOR."Test".DIRECTORY_SEPARATOR."{$class}Test.php";
210 210
         $test = true;
211
-        if(!file_exists($filename)) {
211
+        if (!file_exists($filename)) {
212 212
             $testTemplate = $this->tpl->dump("generator/testCase.template.twig", array(
213 213
                 "module" => $module,
214 214
                 "namespace" => preg_replace('/(\\\|\/)/', '\\', $module),
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
     private function generateBaseApiTemplate($module, $modPath, $force = false, $apiClass = "")
230 230
     {
231 231
         $created = true;
232
-        $modelPath = $modPath . $module . DIRECTORY_SEPARATOR . 'Models';
233
-        $apiPath = $modPath . $module . DIRECTORY_SEPARATOR . 'Api';
232
+        $modelPath = $modPath.$module.DIRECTORY_SEPARATOR.'Models';
233
+        $apiPath = $modPath.$module.DIRECTORY_SEPARATOR.'Api';
234 234
         if (file_exists($modelPath)) {
235 235
             $dir = dir($modelPath);
236 236
             $this->generateApiFiles($module, $force, $apiClass, $dir, $apiPath);
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         //Generamos el fichero de configuración
249 249
         $this->log->addLog("Generamos fichero vacío de configuración");
250 250
         return $this->writeTemplateToFile("<?php\n\t",
251
-            $mod_path . DIRECTORY_SEPARATOR . "Config" . DIRECTORY_SEPARATOR . "config.php",
251
+            $mod_path.DIRECTORY_SEPARATOR."Config".DIRECTORY_SEPARATOR."config.php",
252 252
             $force);
253 253
     }
254 254
 
@@ -263,10 +263,10 @@  discard block
 block discarded – undo
263 263
         //Generamos el fichero de configuración
264 264
         $this->log->addLog("Generamos ficheros para assets base");
265 265
         $css = $this->writeTemplateToFile("/* CSS3 STYLES */\n\n",
266
-            $mod_path . DIRECTORY_SEPARATOR . "Public" . DIRECTORY_SEPARATOR . "css" . DIRECTORY_SEPARATOR . "styles.css",
266
+            $mod_path.DIRECTORY_SEPARATOR."Public".DIRECTORY_SEPARATOR."css".DIRECTORY_SEPARATOR."styles.css",
267 267
             $force);
268 268
         $js = $this->writeTemplateToFile("/* APP MODULE JS */\n\n(function() {\n\t'use strict';\n})();",
269
-            $mod_path . DIRECTORY_SEPARATOR . "Public" . DIRECTORY_SEPARATOR . "js" . DIRECTORY_SEPARATOR . "app.js",
269
+            $mod_path.DIRECTORY_SEPARATOR."Public".DIRECTORY_SEPARATOR."js".DIRECTORY_SEPARATOR."app.js",
270 270
             $force);
271 271
         return ($css && $js);
272 272
     }
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
             "class" => $class,
289 289
         ));
290 290
         return $this->writeTemplateToFile($controller,
291
-            $mod_path . DIRECTORY_SEPARATOR . "Services" . DIRECTORY_SEPARATOR . "{$class}Service.php",
291
+            $mod_path.DIRECTORY_SEPARATOR."Services".DIRECTORY_SEPARATOR."{$class}Service.php",
292 292
             $force);
293 293
     }
294 294
 
@@ -307,13 +307,13 @@  discard block
 block discarded – undo
307 307
             "autoloader" => preg_replace('/(\\\|\/)/', '_', $module),
308 308
             "regex" => preg_replace('/(\\\|\/)/m', '\\\\\\\\\\\\', $module),
309 309
         ));
310
-        $autoload = $this->writeTemplateToFile($autoloader, $mod_path . DIRECTORY_SEPARATOR . "autoload.php", $force);
310
+        $autoload = $this->writeTemplateToFile($autoloader, $mod_path.DIRECTORY_SEPARATOR."autoload.php", $force);
311 311
 
312 312
         $this->log->addLog("Generamos el phpunit");
313 313
         $phpUnitTemplate = $this->tpl->dump("generator/phpunit.template.twig", array(
314 314
             "module" => $module,
315 315
         ));
316
-        $phpunit = $this->writeTemplateToFile($phpUnitTemplate, $mod_path . DIRECTORY_SEPARATOR . "phpunit.xml.dist", $force);
316
+        $phpunit = $this->writeTemplateToFile($phpUnitTemplate, $mod_path.DIRECTORY_SEPARATOR."phpunit.xml.dist", $force);
317 317
         return $autoload && $phpunit;
318 318
     }
319 319
 
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
             "db" => $this->config->get("db_name"),
335 335
         ));
336 336
         return $this->writeTemplateToFile($schema,
337
-            $mod_path . DIRECTORY_SEPARATOR . "Config" . DIRECTORY_SEPARATOR . "schema.xml",
337
+            $mod_path.DIRECTORY_SEPARATOR."Config".DIRECTORY_SEPARATOR."schema.xml",
338 338
             $force);
339 339
     }
340 340
 
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
             "namespace" => preg_replace('/(\\\|\/)/', '', $module),
353 353
         ));
354 354
         return $this->writeTemplateToFile($build_properties,
355
-            $mod_path . DIRECTORY_SEPARATOR . "Config" . DIRECTORY_SEPARATOR . "propel.yml",
355
+            $mod_path.DIRECTORY_SEPARATOR."Config".DIRECTORY_SEPARATOR."propel.yml",
356 356
             $force);
357 357
     }
358 358
 
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
             "module" => $module,
371 371
         ));
372 372
         return $this->writeTemplateToFile($index,
373
-            $mod_path . DIRECTORY_SEPARATOR . "Templates" . DIRECTORY_SEPARATOR . "index.html.twig",
373
+            $mod_path.DIRECTORY_SEPARATOR."Templates".DIRECTORY_SEPARATOR."index.html.twig",
374 374
             $force);
375 375
     }
376 376
 
@@ -388,11 +388,11 @@  discard block
 block discarded – undo
388 388
             try {
389 389
                 $this->cache->storeData($filename, $fileContent, Cache::TEXT, true);
390 390
                 $created = true;
391
-            } catch (\Exception $e) {
391
+            }catch (\Exception $e) {
392 392
                 Logger::log($e->getMessage(), LOG_ERR);
393 393
             }
394
-        } else {
395
-            Logger::log($filename . t(' not exists or cant write'), LOG_ERR);
394
+        }else {
395
+            Logger::log($filename.t(' not exists or cant write'), LOG_ERR);
396 396
         }
397 397
         return $created;
398 398
     }
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
         ));
424 424
 
425 425
         return $this->writeTemplateToFile($controller,
426
-            $mod_path . DIRECTORY_SEPARATOR . 'base' . DIRECTORY_SEPARATOR . "{$api}BaseApi.php", true);
426
+            $mod_path.DIRECTORY_SEPARATOR.'base'.DIRECTORY_SEPARATOR."{$api}BaseApi.php", true);
427 427
     }
428 428
 
429 429
     /**
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
             "package" => $package,
449 449
         ));
450 450
 
451
-        return $this->writeTemplateToFile($controller, $mod_path . DIRECTORY_SEPARATOR . "{$api}.php", $force);
451
+        return $this->writeTemplateToFile($controller, $mod_path.DIRECTORY_SEPARATOR."{$api}.php", $force);
452 452
     }
453 453
 
454 454
     /**
@@ -462,12 +462,12 @@  discard block
 block discarded – undo
462 462
     {
463 463
         if (file_exists($filename_path)) {
464 464
             $destfolder = basename($filename_path);
465
-            if (!file_exists(WEB_DIR . $dest . DIRECTORY_SEPARATOR . $destfolder) || $debug || $force) {
465
+            if (!file_exists(WEB_DIR.$dest.DIRECTORY_SEPARATOR.$destfolder) || $debug || $force) {
466 466
                 if (is_dir($filename_path)) {
467
-                    self::copyr($filename_path, WEB_DIR . $dest . DIRECTORY_SEPARATOR . $destfolder);
468
-                } else {
469
-                    if (@copy($filename_path, WEB_DIR . $dest . DIRECTORY_SEPARATOR . $destfolder) === FALSE) {
470
-                        throw new ConfigException("Can't copy " . $filename_path . " to " . WEB_DIR . $dest . DIRECTORY_SEPARATOR . $destfolder);
467
+                    self::copyr($filename_path, WEB_DIR.$dest.DIRECTORY_SEPARATOR.$destfolder);
468
+                }else {
469
+                    if (@copy($filename_path, WEB_DIR.$dest.DIRECTORY_SEPARATOR.$destfolder) === FALSE) {
470
+                        throw new ConfigException("Can't copy ".$filename_path." to ".WEB_DIR.$dest.DIRECTORY_SEPARATOR.$destfolder);
471 471
                     }
472 472
                 }
473 473
             }
@@ -486,10 +486,10 @@  discard block
 block discarded – undo
486 486
         GeneratorHelper::createDir($dst);
487 487
         while (false !== ($file = readdir($dir))) {
488 488
             if (($file != '.') && ($file != '..')) {
489
-                if (is_dir($src . '/' . $file)) {
490
-                    self::copyr($src . '/' . $file, $dst . '/' . $file);
491
-                } elseif (@copy($src . '/' . $file, $dst . '/' . $file) === false) {
492
-                    throw new ConfigException("Can't copy " . $src . " to " . $dst);
489
+                if (is_dir($src.'/'.$file)) {
490
+                    self::copyr($src.'/'.$file, $dst.'/'.$file);
491
+                } elseif (@copy($src.'/'.$file, $dst.'/'.$file) === false) {
492
+                    throw new ConfigException("Can't copy ".$src." to ".$dst);
493 493
                 }
494 494
             }
495 495
         }
@@ -502,12 +502,12 @@  discard block
 block discarded – undo
502 502
      */
503 503
     private function getPropelPaths($module_path)
504 504
     {
505
-        $moduleDir = CORE_DIR . DIRECTORY_SEPARATOR . $module_path;
505
+        $moduleDir = CORE_DIR.DIRECTORY_SEPARATOR.$module_path;
506 506
         GeneratorHelper::createDir($moduleDir);
507 507
         $moduleDir = realpath($moduleDir);
508
-        $configDir = $moduleDir . DIRECTORY_SEPARATOR . 'Config';
509
-        $sqlDir = $moduleDir . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR . 'Sql';
510
-        $migrationDir = $moduleDir . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR . 'Migrations';
508
+        $configDir = $moduleDir.DIRECTORY_SEPARATOR.'Config';
509
+        $sqlDir = $moduleDir.DIRECTORY_SEPARATOR.'Config'.DIRECTORY_SEPARATOR.'Sql';
510
+        $migrationDir = $moduleDir.DIRECTORY_SEPARATOR.'Config'.DIRECTORY_SEPARATOR.'Migrations';
511 511
         $paths = [
512 512
             'projectDir' => $moduleDir,
513 513
             'outputDir' => $moduleDir,
@@ -572,9 +572,9 @@  discard block
 block discarded – undo
572 572
     private function setupManager(GeneratorConfig $configGenerator, AbstractManager &$manager, $workingDir = CORE_DIR)
573 573
     {
574 574
         $manager->setGeneratorConfig($configGenerator);
575
-        $schemaFile = new \SplFileInfo($configGenerator->getSection('paths')['schemaDir'] . DIRECTORY_SEPARATOR . 'schema.xml');
575
+        $schemaFile = new \SplFileInfo($configGenerator->getSection('paths')['schemaDir'].DIRECTORY_SEPARATOR.'schema.xml');
576 576
         $manager->setSchemas([$schemaFile]);
577
-        $manager->setLoggerClosure(function ($message) {
577
+        $manager->setLoggerClosure(function($message) {
578 578
             Logger::log($message, LOG_INFO);
579 579
         });
580 580
         $manager->setWorkingDirectory($workingDir);
@@ -593,9 +593,9 @@  discard block
 block discarded – undo
593 593
         $base = $dir->path;
594 594
         while ($file = $dir->read()) {
595 595
             if (!in_array(strtolower($file), ['.', '..', 'base', 'map'])) {
596
-                if (is_dir($base . DIRECTORY_SEPARATOR . $file)) {
597
-                    $this->generateApiFiles($module, $force, $apiClass, dir($base . DIRECTORY_SEPARATOR . $file), $apiPath . DIRECTORY_SEPARATOR . $file, $file);
598
-                } else if (!preg_match('/Query\.php$/i', $file)
596
+                if (is_dir($base.DIRECTORY_SEPARATOR.$file)) {
597
+                    $this->generateApiFiles($module, $force, $apiClass, dir($base.DIRECTORY_SEPARATOR.$file), $apiPath.DIRECTORY_SEPARATOR.$file, $file);
598
+                }else if (!preg_match('/Query\.php$/i', $file)
599 599
                     && preg_match('/\.php$/i', $file)
600 600
                 ) {
601 601
                     $filename = str_replace(".php", "", $file);
Please login to merge, or discard this patch.
src/base/types/helpers/ServiceHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     const TYPE_HTTP = 2;
12 12
 
13 13
     public static function parseRawData($type, $params) {
14
-        switch($type) {
14
+        switch ($type) {
15 15
             default:
16 16
             case self::TYPE_HTTP:
17 17
                 $parsedParams = http_build_query($params);
Please login to merge, or discard this patch.
src/base/Logger.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 
19 19
 
20 20
 if (!defined('LOG_DIR')) {
21
-    GeneratorHelper::createDir(BASE_DIR . DIRECTORY_SEPARATOR . 'logs');
22
-    define('LOG_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'logs');
21
+    GeneratorHelper::createDir(BASE_DIR.DIRECTORY_SEPARATOR.'logs');
22
+    define('LOG_DIR', BASE_DIR.DIRECTORY_SEPARATOR.'logs');
23 23
 }
24 24
 
25 25
 /**
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
     {
58 58
         $args = func_get_args();
59 59
         list($logger, $debug, $path) = $this->setup($args);
60
-        $this->stream = fopen($path . DIRECTORY_SEPARATOR . date('Ymd') . '.log', 'a+');
60
+        $this->stream = fopen($path.DIRECTORY_SEPARATOR.date('Ymd').'.log', 'a+');
61 61
         if (is_resource($this->stream)) {
62 62
             $this->addPushLogger($logger, $debug);
63
-        } else {
63
+        }else {
64 64
             throw new ConfigException(t('Error creating logger'));
65 65
         }
66 66
         $this->logLevel = strtoupper(Config::getParam('log.level', 'NOTICE'));
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     private function createLoggerPath()
142 142
     {
143 143
         $logger = $this->setLoggerName();
144
-        $path = LOG_DIR . DIRECTORY_SEPARATOR . $logger . DIRECTORY_SEPARATOR . date('Y') . DIRECTORY_SEPARATOR . date('m');
144
+        $path = LOG_DIR.DIRECTORY_SEPARATOR.$logger.DIRECTORY_SEPARATOR.date('Y').DIRECTORY_SEPARATOR.date('m');
145 145
         GeneratorHelper::createDir($path);
146 146
         return $path;
147 147
     }
Please login to merge, or discard this patch.
src/base/types/CurlService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     {
88 88
         $headers = [];
89 89
         foreach ($this->getHeaders() as $key => $value) {
90
-            $headers[] = $key . ': ' . $value;
90
+            $headers[] = $key.': '.$value;
91 91
         }
92 92
         $headers[self::PSFS_TRACK_HEADER] = Logger::getUid();
93 93
         if (count($headers)) {
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             case Request::VERB_GET:
118 118
                 if (!empty($this->params)) {
119 119
                     $sep = false === strpos($this->getUrl(), '?') ? '?' : '';
120
-                    $this->setUrl($this->getUrl() . $sep . http_build_query($this->getParams()), false);
120
+                    $this->setUrl($this->getUrl().$sep.http_build_query($this->getParams()), false);
121 121
                 }
122 122
                 break;
123 123
             case Request::VERB_POST:
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         if ($this->isDebug() && is_resource($verbose)) {
150 150
             $this->dumpVerboseLogs($verbose);
151 151
         }
152
-        Logger::log($this->getUrl() . ' response: ', LOG_DEBUG, is_array($this->result) ? $this->result : [$this->result]);
152
+        Logger::log($this->getUrl().' response: ', LOG_DEBUG, is_array($this->result) ? $this->result : [$this->result]);
153 153
         $this->info = array_merge($this->info, curl_getinfo($this->con));
154 154
     }
155 155
 
Please login to merge, or discard this patch.
src/base/types/traits/Helper/ParameterTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      * @return ParameterTrait
50 50
      */
51 51
     public function dropParam($key) {
52
-        if(array_key_exists($key, $this->params)) {
52
+        if (array_key_exists($key, $this->params)) {
53 53
             unset($this->params[$key]);
54 54
         }
55 55
         return $this;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      * @return mixed|null
61 61
      */
62 62
     public function getParam($key) {
63
-        if(array_key_exists($key, $this->params)) {
63
+        if (array_key_exists($key, $this->params)) {
64 64
             return $this->params[$key];
65 65
         }
66 66
         return null;
Please login to merge, or discard this patch.
src/base/types/traits/Helper/OptionTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      * @return OptionTrait
49 49
      */
50 50
     public function dropOption($key) {
51
-        if(array_key_exists($key, $this->options)) {
51
+        if (array_key_exists($key, $this->options)) {
52 52
             unset($this->options[$key]);
53 53
         }
54 54
         return $this;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      * @return mixed|null
60 60
      */
61 61
     public function getOption($key) {
62
-        if(array_key_exists($key, $this->options)) {
62
+        if (array_key_exists($key, $this->options)) {
63 63
             return $this->options[$key];
64 64
         }
65 65
         return null;
Please login to merge, or discard this patch.
src/base/types/traits/CurlTrait.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
     protected $isMultipart = false;
73 73
 
74 74
     protected function closeConnection() {
75
-        if(null !== $this->con) {
76
-            if(is_resource($this->con)) {
75
+        if (null !== $this->con) {
76
+            if (is_resource($this->con)) {
77 77
                 curl_close($this->con);
78
-            } else {
78
+            }else {
79 79
                 $this->setCon(null);
80 80
             }
81 81
         }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $this->params = [];
92 92
         $this->headers = [];
93 93
         $this->debug = 'debug' === strtolower(Config::getParam('log.level', 'notice'));
94
-        Logger::log('Context service for ' . static::class . ' cleared!');
94
+        Logger::log('Context service for '.static::class.' cleared!');
95 95
         $this->closeConnection();
96 96
     }
97 97
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     {
100 100
         $this->clearContext();
101 101
         $con = curl_init($this->url);
102
-        if(is_resource($con)) {
102
+        if (is_resource($con)) {
103 103
             $this->setCon($con);
104 104
         }
105 105
     }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     public function setUrl($url, $cleanContext = true)
120 120
     {
121 121
         $this->url = $url;
122
-        if($cleanContext) {
122
+        if ($cleanContext) {
123 123
             $this->initialize();
124 124
         }
125 125
     }
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      */
185 185
     public function setIsJson($isJson = true) {
186 186
         $this->isJson = $isJson;
187
-        if($isJson) {
187
+        if ($isJson) {
188 188
             $this->setIsMultipart(false);
189 189
         }
190 190
     }
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
      */
202 202
     public function setIsMultipart($isMultipart = true) {
203 203
         $this->isMultipart = $isMultipart;
204
-        if($isMultipart) {
204
+        if ($isMultipart) {
205 205
             $this->setIsJson(false);
206 206
         }
207 207
     }
Please login to merge, or discard this patch.
src/controller/UserController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
                 Logger::log('Configuration saved successful');
63 63
                 Security::getInstance()->setFlash("callback_message", t("Usuario agregado correctamente"));
64 64
                 Security::getInstance()->setFlash("callback_route", Router::getInstance()->getRoute("admin", true));
65
-            } else {
65
+            }else {
66 66
                 throw new ConfigException(t('Error al guardar los administradores, prueba a cambiar los permisos'));
67 67
             }
68 68
         }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     {
99 99
         if ($this->isAdmin()) {
100 100
             return $this->redirect('admin');
101
-        } else {
101
+        }else {
102 102
             return Admin::staticAdminLogon($route);
103 103
         }
104 104
     }
Please login to merge, or discard this patch.
src/controller/base/Admin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,9 +35,9 @@
 block discarded – undo
35 35
      */
36 36
     public static function staticAdminLogon($route = null)
37 37
     {
38
-        if (file_exists(CONFIG_DIR . DIRECTORY_SEPARATOR . 'admins.json')) {
38
+        if (file_exists(CONFIG_DIR.DIRECTORY_SEPARATOR.'admins.json')) {
39 39
             return AdminServices::getInstance()->setAdminHeaders();
40
-        } else {
40
+        }else {
41 41
             return UserController::showAdminManager();
42 42
         }
43 43
     }
Please login to merge, or discard this patch.