| @@ -22,11 +22,11 @@ discard block | ||
| 22 | 22 |          if (str_starts_with($class, 'PSFS\\')) { | 
| 23 | 23 |              $relativeClass = substr($class, strlen('PSFS\\')); | 
| 24 | 24 | |
| 25 | -            $file = SOURCE_DIR . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $relativeClass) . '.php'; | |
| 25 | +            $file = SOURCE_DIR.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $relativeClass).'.php'; | |
| 26 | 26 | |
| 27 | 27 |              if (file_exists($file)) { | 
| 28 | 28 | require_once $file; | 
| 29 | -            } else if (class_exists('PSFS\\base\\Logger')) { | |
| 29 | +            }else if (class_exists('PSFS\\base\\Logger')) { | |
| 30 | 30 |                  \PSFS\base\Logger::log("[Autoloader] Class $class not found at $file", LOG_WARNING); | 
| 31 | 31 | } | 
| 32 | 32 | } | 
| @@ -35,7 +35,7 @@ discard block | ||
| 35 | 35 | |
| 36 | 36 | // Registro automático del autoloader (puedes comentarlo si lo haces desde bootstrap) | 
| 37 | 37 |  if (!defined('SOURCE_DIR')) { | 
| 38 | -    define('SOURCE_DIR', dirname(__DIR__) . '/src'); | |
| 38 | +    define('SOURCE_DIR', dirname(__DIR__).'/src'); | |
| 39 | 39 | } | 
| 40 | 40 | |
| 41 | 41 | Autoloader::register(); | 
| @@ -26,7 +26,7 @@ discard block | ||
| 26 | 26 | // Creates the src folder | 
| 27 | 27 | GeneratorHelper::createDir($modPath); | 
| 28 | 28 | // Create module path | 
| 29 | - GeneratorHelper::createDir($modPath . $module); | |
| 29 | + GeneratorHelper::createDir($modPath.$module); | |
| 30 | 30 | } | 
| 31 | 31 | |
| 32 | 32 | /** | 
| @@ -42,16 +42,16 @@ discard block | ||
| 42 | 42 |          Logger::log("Generamos la estructura"); | 
| 43 | 43 | $paths = [ | 
| 44 | 44 | "Api", "Config", "Controller", "Models", "Public", "Templates", "Services", "Test", "Doc", | 
| 45 | -            "Locale", "Locale/" . Config::getParam('default.locale', 'es_ES'), "Locale/" . Config::getParam('default.locale', 'es_ES') . "/LC_MESSAGES" | |
| 45 | +            "Locale", "Locale/".Config::getParam('default.locale', 'es_ES'), "Locale/".Config::getParam('default.locale', 'es_ES')."/LC_MESSAGES" | |
| 46 | 46 | ]; | 
| 47 | - $modulePath = $modPath . $module; | |
| 47 | + $modulePath = $modPath.$module; | |
| 48 | 48 |          foreach ($paths as $path) { | 
| 49 | - GeneratorHelper::createDir($modulePath . DIRECTORY_SEPARATOR . $path); | |
| 49 | + GeneratorHelper::createDir($modulePath.DIRECTORY_SEPARATOR.$path); | |
| 50 | 50 | } | 
| 51 | 51 | //Creamos las carpetas de los assets | 
| 52 | 52 |          $htmlPaths = array("css", "js", "img", "media", "font"); | 
| 53 | 53 |          foreach ($htmlPaths as $path) { | 
| 54 | - GeneratorHelper::createDir($modulePath . DIRECTORY_SEPARATOR . "Public" . DIRECTORY_SEPARATOR . $path); | |
| 54 | + GeneratorHelper::createDir($modulePath.DIRECTORY_SEPARATOR."Public".DIRECTORY_SEPARATOR.$path); | |
| 55 | 55 | } | 
| 56 | 56 | } | 
| 57 | 57 | |
| @@ -66,10 +66,10 @@ discard block | ||
| 66 | 66 | //Generamos el fichero de configuración | 
| 67 | 67 |          Logger::log("Generamos ficheros para assets base"); | 
| 68 | 68 |          $css = $this->writeTemplateToFile("/* CSS3 STYLES */\n\n", | 
| 69 | - $modPath . DIRECTORY_SEPARATOR . "Public" . DIRECTORY_SEPARATOR . "css" . DIRECTORY_SEPARATOR . "styles.css", | |
| 69 | + $modPath.DIRECTORY_SEPARATOR."Public".DIRECTORY_SEPARATOR."css".DIRECTORY_SEPARATOR."styles.css", | |
| 70 | 70 | $force); | 
| 71 | 71 |          $js = $this->writeTemplateToFile("/* APP MODULE JS */\n\n(function() {\n\t'use strict';\n})();", | 
| 72 | - $modPath . DIRECTORY_SEPARATOR . "Public" . DIRECTORY_SEPARATOR . "js" . DIRECTORY_SEPARATOR . "app.js", | |
| 72 | + $modPath.DIRECTORY_SEPARATOR."Public".DIRECTORY_SEPARATOR."js".DIRECTORY_SEPARATOR."app.js", | |
| 73 | 73 | $force); | 
| 74 | 74 | return ($css && $js); | 
| 75 | 75 | } | 
| @@ -91,7 +91,7 @@ discard block | ||
| 91 | 91 | "class" => $class, | 
| 92 | 92 | )); | 
| 93 | 93 | return $this->writeTemplateToFile($controller, | 
| 94 | -            $modPath . DIRECTORY_SEPARATOR . "Services" . DIRECTORY_SEPARATOR . "{$class}Service.php", | |
| 94 | +            $modPath.DIRECTORY_SEPARATOR."Services".DIRECTORY_SEPARATOR."{$class}Service.php", | |
| 95 | 95 | $force); | 
| 96 | 96 | } | 
| 97 | 97 | |
| @@ -110,13 +110,13 @@ discard block | ||
| 110 | 110 |              "autoloader" => preg_replace('/(\\\|\/)/', '_', $module), | 
| 111 | 111 |              "regex" => preg_replace('/(\\\|\/)/m', '\\\\\\\\\\\\', $module), | 
| 112 | 112 | )); | 
| 113 | - $autoload = $this->writeTemplateToFile($autoloader, $mod_path . DIRECTORY_SEPARATOR . "autoload.php", true); | |
| 113 | + $autoload = $this->writeTemplateToFile($autoloader, $mod_path.DIRECTORY_SEPARATOR."autoload.php", true); | |
| 114 | 114 | |
| 115 | 115 |          Logger::log("Generamos el phpunit"); | 
| 116 | 116 |          $phpUnitTemplate = $this->tpl->dump("generator/phpunit.template.twig", array( | 
| 117 | 117 | "module" => $module, | 
| 118 | 118 | )); | 
| 119 | - $phpunit = $this->writeTemplateToFile($phpUnitTemplate, $mod_path . DIRECTORY_SEPARATOR . "phpunit.xml.dist", $force); | |
| 119 | + $phpunit = $this->writeTemplateToFile($phpUnitTemplate, $mod_path.DIRECTORY_SEPARATOR."phpunit.xml.dist", $force); | |
| 120 | 120 | return $autoload && $phpunit; | 
| 121 | 121 | } | 
| 122 | 122 | } |