Passed
Push — master ( d59fda...dc7489 )
by Fran
03:09
created
src/base/types/helpers/RouterHelper.php 1 patch
Spacing   +11 added lines, -11 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;
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         $expr = preg_quote($expr, '/');
128 128
         $expr = str_replace('%%%', '(.*)', $expr);
129 129
         $expr2 = preg_replace('/\(\.\*\)$/', '', $expr);
130
-        $matched = preg_match('/^' . $expr . '\/?$/i', $path) || preg_match('/^' . $expr2 . '?$/i', $path);
130
+        $matched = preg_match('/^'.$expr.'\/?$/i', $path) || preg_match('/^'.$expr2.'?$/i', $path);
131 131
         return $matched;
132 132
     }
133 133
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
      */
139 139
     public static function extractDomainInfo(ReflectionClass $class, string $domain): array
140 140
     {
141
-        $path = dirname($class->getFileName()) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR;
141
+        $path = dirname($class->getFileName()).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR;
142 142
         $templatesPath = 'templates';
143 143
         $publicPath = 'public';
144 144
         $modelsPath = 'models';
@@ -148,13 +148,13 @@  discard block
 block discarded – undo
148 148
             $modelsPath = ucfirst($modelsPath);
149 149
         }
150 150
         if ($class->hasConstant('TPL')) {
151
-            $templatesPath .= DIRECTORY_SEPARATOR . $class->getConstant('TPL');
151
+            $templatesPath .= DIRECTORY_SEPARATOR.$class->getConstant('TPL');
152 152
         }
153 153
         return [
154 154
             'base' => $path,
155
-            'template' => $path . $templatesPath,
156
-            'model' => $path . $modelsPath,
157
-            'public' => $path . $publicPath,
155
+            'template' => $path.$templatesPath,
156
+            'model' => $path.$modelsPath,
157
+            'public' => $path.$publicPath,
158 158
         ];
159 159
     }
160 160
 
@@ -175,12 +175,12 @@  discard block
 block discarded – undo
175 175
             foreach ($parameters as $param) {
176 176
                 if ($param->isOptional() && !is_array($param->getDefaultValue())) {
177 177
                     $params[$param->getName()] = $param->getDefaultValue();
178
-                    $default = str_replace('{' . $param->getName() . '}', $param->getDefaultValue() ?: '', $regex ?: '');
178
+                    $default = str_replace('{'.$param->getName().'}', $param->getDefaultValue() ?: '', $regex ?: '');
179 179
                 } elseif (!$param->isOptional()) {
180 180
                     $requirements[] = $param->getName();
181 181
                 }
182 182
             }
183
-        } else {
183
+        }else {
184 184
             $default = $regex;
185 185
         }
186 186
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             $httpMethod = AnnotationHelper::extractReflectionHttpMethod($docComments);
211 211
             $icon = AnnotationHelper::extractDocIcon($docComments);
212 212
             $label = AnnotationHelper::extractReflectionLabel(str_replace('{__API__}', $api, $docComments));
213
-            $route = $httpMethod . "#|#" . $regex;
213
+            $route = $httpMethod."#|#".$regex;
214 214
             $route = preg_replace('/(\\r|\\f|\\t|\\n)/', '', $route);
215 215
             $info = [
216 216
                 '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 && strlen($part) > 0) {
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(bool $isOdd = null): int
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) {
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
         $timestamp = '';
130 130
         $part = strrev($part);
131 131
         for ($i = 0, $ct = strlen($part); $i < $ct; $i++) {
132
-            if ($i % 2 == 0) {
132
+            if ($i%2 == 0) {
133 133
                 $timestamp .= substr($part, $i, 1);
134
-            } else {
134
+            }else {
135 135
                 $partToken .= substr($part, $i, 1);
136 136
             }
137 137
         }
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         list($partToken, $timestamp) = self::extractTs(array_pop($parts));
149 149
         $token = null;
150 150
         if ($timestamp > 0) {
151
-            $token = $partToken . implode('', $parts);
151
+            $token = $partToken.implode('', $parts);
152 152
         }
153 153
         return [$token, $timestamp];
154 154
     }
Please login to merge, or discard this patch.
src/base/types/helpers/GeneratorHelper.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
             $objects = scandir($dir);
28 28
             foreach ($objects as $object) {
29 29
                 if ($object != "." && $object != "..") {
30
-                    if (filetype($dir . "/" . $object) == "dir") {
31
-                        self::deleteDir($dir . "/" . $object);
32
-                    } else {
33
-                        unlink($dir . "/" . $object);
30
+                    if (filetype($dir."/".$object) == "dir") {
31
+                        self::deleteDir($dir."/".$object);
32
+                    }else {
33
+                        unlink($dir."/".$object);
34 34
                     }
35 35
                 }
36 36
             }
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $rootDirs = array("css", "js", "media", "font");
47 47
         foreach ($rootDirs as $dir) {
48
-            if (file_exists(WEB_DIR . DIRECTORY_SEPARATOR . $dir)) {
48
+            if (file_exists(WEB_DIR.DIRECTORY_SEPARATOR.$dir)) {
49 49
                 try {
50
-                    self::deleteDir(WEB_DIR . DIRECTORY_SEPARATOR . $dir);
51
-                } catch (Exception $e) {
50
+                    self::deleteDir(WEB_DIR.DIRECTORY_SEPARATOR.$dir);
51
+                }catch (Exception $e) {
52 52
                     syslog(LOG_INFO, $e->getMessage());
53 53
                 }
54 54
             }
@@ -65,12 +65,12 @@  discard block
 block discarded – undo
65 65
         if (!empty($dir)) {
66 66
             try {
67 67
                 if (!is_dir($dir) && @mkdir($dir, 0775, true) === false) {
68
-                    throw new Exception(t('Can\'t create directory ') . $dir);
68
+                    throw new Exception(t('Can\'t create directory ').$dir);
69 69
                 }
70
-            } catch (Exception $e) {
70
+            }catch (Exception $e) {
71 71
                 syslog(LOG_WARNING, $e->getMessage());
72 72
                 if (!file_exists(dirname($dir))) {
73
-                    throw new GeneratorException($e->getMessage() . $dir);
73
+                    throw new GeneratorException($e->getMessage().$dir);
74 74
                 }
75 75
             }
76 76
         }
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public static function getTemplatePath(): string
84 84
     {
85
-        $path = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR;
85
+        $path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR;
86 86
         return realpath($path);
87 87
     }
88 88
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                 } elseif (!$reflector->isAbstract()) {
111 111
                     throw new GeneratorException(t('La clase definida debe ser abstracta'), 501);
112 112
                 }
113
-            } else {
113
+            }else {
114 114
                 throw new GeneratorException(t('La clase definida para extender la API no existe'), 501);
115 115
             }
116 116
         }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         GeneratorHelper::createDir($path);
133 133
         $paths = array("js", "css", "img", "media", "font");
134 134
         foreach ($paths as $htmlPath) {
135
-            GeneratorHelper::createDir($path . DIRECTORY_SEPARATOR . $htmlPath);
135
+            GeneratorHelper::createDir($path.DIRECTORY_SEPARATOR.$htmlPath);
136 136
         }
137 137
 
138 138
         // Generates the root needed files
@@ -142,31 +142,31 @@  discard block
 block discarded – undo
142 142
             'crossdomain' => 'crossdomain.xml',
143 143
             'humans' => 'humans.txt',
144 144
             'robots' => 'robots.txt',
145
-            'docker' => '..' . DIRECTORY_SEPARATOR . 'docker-compose.yml',
145
+            'docker' => '..'.DIRECTORY_SEPARATOR.'docker-compose.yml',
146 146
         ];
147 147
         $verificable = ['humans', 'robots', 'docker'];
148 148
         $output->writeln('Start creating html files');
149 149
         foreach ($files as $template => $filename) {
150
-            if (in_array($template, $verificable) && file_exists($path . DIRECTORY_SEPARATOR . $filename)) {
151
-                $output->writeln($filename . ' already exists');
150
+            if (in_array($template, $verificable) && file_exists($path.DIRECTORY_SEPARATOR.$filename)) {
151
+                $output->writeln($filename.' already exists');
152 152
                 continue;
153 153
             }
154
-            $text = Template::getInstance()->dump("generator/html/" . $template . '.html.twig');
155
-            if (false === file_put_contents($path . DIRECTORY_SEPARATOR . $filename, $text)) {
154
+            $text = Template::getInstance()->dump("generator/html/".$template.'.html.twig');
155
+            if (false === file_put_contents($path.DIRECTORY_SEPARATOR.$filename, $text)) {
156 156
                 if (!$quiet) {
157
-                    $output->writeln('Can\t create the file ' . $filename);
157
+                    $output->writeln('Can\t create the file '.$filename);
158 158
                 }
159
-            } else {
159
+            }else {
160 160
                 if (!$quiet) {
161
-                    $output->writeln($filename . ' created successfully');
161
+                    $output->writeln($filename.' created successfully');
162 162
                 }
163 163
             }
164 164
         }
165 165
 
166 166
         //Export base locale translations
167
-        if (!file_exists(BASE_DIR . DIRECTORY_SEPARATOR . 'locale')) {
168
-            GeneratorHelper::createDir(BASE_DIR . DIRECTORY_SEPARATOR . 'locale');
169
-            self::copyr(SOURCE_DIR . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'locale', BASE_DIR . DIRECTORY_SEPARATOR . 'locale');
167
+        if (!file_exists(BASE_DIR.DIRECTORY_SEPARATOR.'locale')) {
168
+            GeneratorHelper::createDir(BASE_DIR.DIRECTORY_SEPARATOR.'locale');
169
+            self::copyr(SOURCE_DIR.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'locale', BASE_DIR.DIRECTORY_SEPARATOR.'locale');
170 170
         }
171 171
     }
172 172
 
@@ -182,12 +182,12 @@  discard block
 block discarded – undo
182 182
     {
183 183
         if (file_exists($filenamePath)) {
184 184
             $destfolder = basename($filenamePath);
185
-            if (!file_exists(WEB_DIR . $dest . DIRECTORY_SEPARATOR . $destfolder) || $debug || $force) {
185
+            if (!file_exists(WEB_DIR.$dest.DIRECTORY_SEPARATOR.$destfolder) || $debug || $force) {
186 186
                 if (is_dir($filenamePath)) {
187
-                    self::copyr($filenamePath, WEB_DIR . $dest . DIRECTORY_SEPARATOR . $destfolder);
188
-                } else {
189
-                    if (@copy($filenamePath, WEB_DIR . $dest . DIRECTORY_SEPARATOR . $destfolder) === FALSE) {
190
-                        throw new ConfigException("Can't copy " . $filenamePath . " to " . WEB_DIR . $dest . DIRECTORY_SEPARATOR . $destfolder);
187
+                    self::copyr($filenamePath, WEB_DIR.$dest.DIRECTORY_SEPARATOR.$destfolder);
188
+                }else {
189
+                    if (@copy($filenamePath, WEB_DIR.$dest.DIRECTORY_SEPARATOR.$destfolder) === FALSE) {
190
+                        throw new ConfigException("Can't copy ".$filenamePath." to ".WEB_DIR.$dest.DIRECTORY_SEPARATOR.$destfolder);
191 191
                     }
192 192
                 }
193 193
             }
@@ -206,10 +206,10 @@  discard block
 block discarded – undo
206 206
         self::createDir($dst);
207 207
         while (false !== ($file = readdir($dir))) {
208 208
             if (($file != '.') && ($file != '..')) {
209
-                if (is_dir($src . '/' . $file)) {
210
-                    self::copyr($src . '/' . $file, $dst . '/' . $file);
211
-                } elseif (@copy($src . '/' . $file, $dst . '/' . $file) === false) {
212
-                    throw new ConfigException("Can't copy " . $src . " to " . $dst);
209
+                if (is_dir($src.'/'.$file)) {
210
+                    self::copyr($src.'/'.$file, $dst.'/'.$file);
211
+                } elseif (@copy($src.'/'.$file, $dst.'/'.$file) === false) {
212
+                    throw new ConfigException("Can't copy ".$src." to ".$dst);
213 213
                 }
214 214
             }
215 215
         }
Please login to merge, or discard this patch.
src/base/types/helpers/AnnotationHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
      */
97 97
     public static function extractFromDoc(string $needle, string $comments, string $default = null): ?string
98 98
     {
99
-        preg_match('/@' . $needle . '\ (.*)(\n|\r)/im', $comments, $matches);
99
+        preg_match('/@'.$needle.'\ (.*)(\n|\r)/im', $comments, $matches);
100 100
         return (count($matches) > 0) ? $matches[1] : $default;
101 101
     }
102 102
 }
Please login to merge, or discard this patch.
src/base/types/helpers/DeployHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@
 block discarded – undo
24 24
         $now = new DateTime();
25 25
         $now->setTimezone(new DateTimeZone(Config::getParam('project.timezone', 'Europe/Madrid')));
26 26
         $config = Config::getInstance()->dumpConfig();
27
-        if (file_exists(CACHE_DIR . DIRECTORY_SEPARATOR . $config[self::CACHE_VAR_TAG] . '.file.cache')) {
28
-            unlink(CACHE_DIR . DIRECTORY_SEPARATOR . $config[self::CACHE_VAR_TAG] . '.file.cache');
27
+        if (file_exists(CACHE_DIR.DIRECTORY_SEPARATOR.$config[self::CACHE_VAR_TAG].'.file.cache')) {
28
+            unlink(CACHE_DIR.DIRECTORY_SEPARATOR.$config[self::CACHE_VAR_TAG].'.file.cache');
29 29
         }
30
-        $config[self::CACHE_VAR_TAG] = 'v' . $now->format('Ymd.His');
30
+        $config[self::CACHE_VAR_TAG] = 'v'.$now->format('Ymd.His');
31 31
         Config::save($config);
32 32
         return $config[self::CACHE_VAR_TAG];
33 33
     }
Please login to merge, or discard this patch.
src/base/types/helpers/I18nHelper.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
         // TODO check more en locales
47 47
         if (strtolower($locale) === 'en') {
48 48
             $locale = 'en_GB';
49
-        } else {
50
-            $locale = $locale . '_' . strtoupper($locale);
49
+        }else {
50
+            $locale = $locale.'_'.strtoupper($locale);
51 51
         }
52 52
         $defaultLocales = explode(',', Config::getParam('i18n.locales', ''));
53 53
         if (!in_array($locale, array_merge($defaultLocales, self::$langs))) {
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         $translations = array();
67 67
         if (file_exists($absoluteFileName)) {
68 68
             @include($absoluteFileName);
69
-        } else {
69
+        }else {
70 70
             Cache::getInstance()->storeData($absoluteFileName, "<?php \$translations = array();\n", Cache::TEXT, TRUE);
71 71
         }
72 72
 
@@ -83,13 +83,13 @@  discard block
 block discarded – undo
83 83
     public static function setLocale(string $default = null, string $customKey = null, bool $force = false): void
84 84
     {
85 85
         $locale = $force ? $default : self::extractLocale($default);
86
-        Inspector::stats('[i18NHelper] Set locale to project [' . $locale . ']', Inspector::SCOPE_DEBUG);
86
+        Inspector::stats('[i18NHelper] Set locale to project ['.$locale.']', Inspector::SCOPE_DEBUG);
87 87
         // Load translations
88
-        putenv("LC_ALL=" . $locale);
88
+        putenv("LC_ALL=".$locale);
89 89
         setlocale(LC_ALL, $locale);
90 90
         // Load the locale path
91
-        $localePath = BASE_DIR . DIRECTORY_SEPARATOR . 'locale';
92
-        Logger::log('Set locale dir ' . $localePath);
91
+        $localePath = BASE_DIR.DIRECTORY_SEPARATOR.'locale';
92
+        Logger::log('Set locale dir '.$localePath);
93 93
         GeneratorHelper::createDir($localePath);
94 94
         bindtextdomain('translations', $localePath);
95 95
         textdomain('translations');
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
             ['i', 'i', 'i', 'i', 'I', 'I', 'I', 'I'],
156 156
             ['o', 'o', 'o', 'o', 'O', 'O', 'O', 'O'],
157 157
             ['u', 'u', 'u', 'u', 'U', 'U', 'U', 'U'],
158
-            ['n', 'N', 'c', 'C',],
158
+            ['n', 'N', 'c', 'C', ],
159 159
         ];
160 160
 
161 161
         $text = htmlspecialchars($string);
@@ -175,24 +175,24 @@  discard block
 block discarded – undo
175 175
      */
176 176
     public static function findTranslations(string $path, string $locale): array
177 177
     {
178
-        $localePath = realpath(BASE_DIR . DIRECTORY_SEPARATOR . 'locale');
179
-        $localePath .= DIRECTORY_SEPARATOR . $locale . DIRECTORY_SEPARATOR . 'LC_MESSAGES' . DIRECTORY_SEPARATOR;
178
+        $localePath = realpath(BASE_DIR.DIRECTORY_SEPARATOR.'locale');
179
+        $localePath .= DIRECTORY_SEPARATOR.$locale.DIRECTORY_SEPARATOR.'LC_MESSAGES'.DIRECTORY_SEPARATOR;
180 180
 
181 181
         $translations = array();
182 182
         if (file_exists($path)) {
183 183
             $directory = dir($path);
184 184
             while (false !== ($fileName = $directory->read())) {
185 185
                 GeneratorHelper::createDir($localePath);
186
-                if (!file_exists($localePath . 'translations.po')) {
187
-                    file_put_contents($localePath . 'translations.po', '');
186
+                if (!file_exists($localePath.'translations.po')) {
187
+                    file_put_contents($localePath.'translations.po', '');
188 188
                 }
189
-                $inspectPath = realpath($path . DIRECTORY_SEPARATOR . $fileName);
190
-                $cmdPhp = "export PATH=\$PATH:/opt/local/bin; xgettext " .
191
-                    $inspectPath . DIRECTORY_SEPARATOR .
189
+                $inspectPath = realpath($path.DIRECTORY_SEPARATOR.$fileName);
190
+                $cmdPhp = "export PATH=\$PATH:/opt/local/bin; xgettext ".
191
+                    $inspectPath.DIRECTORY_SEPARATOR.
192 192
                     "*.php --from-code=UTF-8 -j -L PHP --debug --force-po -o {$localePath}translations.po";
193
-                if (is_dir($path . DIRECTORY_SEPARATOR . $fileName) && preg_match('/^\./', $fileName) == 0) {
194
-                    $res = t('Revisando directorio: ') . $inspectPath;
195
-                    $res .= t('Comando ejecutado: ') . $cmdPhp;
193
+                if (is_dir($path.DIRECTORY_SEPARATOR.$fileName) && preg_match('/^\./', $fileName) == 0) {
194
+                    $res = t('Revisando directorio: ').$inspectPath;
195
+                    $res .= t('Comando ejecutado: ').$cmdPhp;
196 196
                     $res .= shell_exec($cmdPhp);
197 197
                     usleep(10);
198 198
                     $translations[] = $res;
Please login to merge, or discard this patch.
src/base/types/helpers/InjectorHelper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
                         'required' => $isRequired,
44 44
                         'description' => $label,
45 45
                     ];
46
-                } else {
46
+                }else {
47 47
                     $instance = new ReflectionClass($instanceType);
48 48
                     $variables[$property->getName()] = [
49 49
                         'is_array' => $isArray,
@@ -159,13 +159,13 @@  discard block
 block discarded – undo
159 159
      */
160 160
     public static function constructInjectableInstance($variable, $singleton, $classNameSpace, $calledClass)
161 161
     {
162
-        Logger::log('Create inyectable instance for ' . $classNameSpace);
162
+        Logger::log('Create inyectable instance for '.$classNameSpace);
163 163
         $reflector = new ReflectionClass($calledClass);
164 164
         $property = $reflector->getProperty($variable);
165 165
         $varInstanceType = (null === $classNameSpace) ? InjectorHelper::extractVarType($property->getDocComment()) : $classNameSpace;
166 166
         if (true === $singleton && method_exists($varInstanceType, 'getInstance')) {
167 167
             $instance = $varInstanceType::getInstance();
168
-        } else {
168
+        }else {
169 169
             $instance = new $varInstanceType();
170 170
         }
171 171
         return $instance;
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     public static function getClassProperties($class)
180 180
     {
181 181
         $properties = [];
182
-        Logger::log('Extracting annotations properties from class ' . $class);
182
+        Logger::log('Extracting annotations properties from class '.$class);
183 183
         $selfReflector = new ReflectionClass($class);
184 184
         if (false !== $selfReflector->getParentClass()) {
185 185
             $properties = self::getClassProperties($selfReflector->getParentClass()->getName());
Please login to merge, or discard this patch.
src/base/types/helpers/Inspector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
     {
53 53
         return [
54 54
             'ts' => round($stats['ts'] - $timestamp, 4),
55
-            'mem' => round(($stats['mem'] - $mem) / 1024 / 1024, 4),
55
+            'mem' => round(($stats['mem'] - $mem)/1024/1024, 4),
56 56
             'files' => $stats['files'] - $files,
57 57
             'name' => $stats['name'],
58 58
         ];
Please login to merge, or discard this patch.
src/base/types/helpers/AssetsHelper.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -66,26 +66,26 @@  discard block
 block discarded – undo
66 66
      *
67 67
      * @return string[]
68 68
      */
69
-    public static function calculateAssetPath(string $string, string|null $name = null, bool $return = true, string $filenamePath = ''): array
69
+    public static function calculateAssetPath(string $string, string | null $name = null, bool $return = true, string $filenamePath = ''): array
70 70
     {
71 71
         $path = explode("/", $string);
72 72
         $originalFilename = end($path);
73
-        $base = WEB_DIR . DIRECTORY_SEPARATOR;
73
+        $base = WEB_DIR.DIRECTORY_SEPARATOR;
74 74
         $debug = Config::getParam('debug');
75 75
         $cache = Config::getParam('cache.var');
76
-        $cache = $cache ? '.' . $cache : '';
76
+        $cache = $cache ? '.'.$cache : '';
77 77
         $finfo = finfo_open(FILEINFO_MIME_TYPE); // devuelve el tipo mime de su extensión
78 78
         $mime = finfo_file($finfo, $filenamePath);
79 79
         $extension = explode(".", $string);
80 80
         $extension = end($extension);
81
-        $file = "/" . substr(md5($string), 0, 8) . "." . $extension;
81
+        $file = "/".substr(md5($string), 0, 8).".".$extension;
82 82
         $htmlBase = '';
83 83
         finfo_close($finfo);
84 84
         if (preg_match('/\.css$/i', $string)) {
85
-            $file = "/" . substr(md5($string), 0, 8) . "$cache.css";
85
+            $file = "/".substr(md5($string), 0, 8)."$cache.css";
86 86
             $htmlBase = "css";
87 87
         } elseif (preg_match('/\.js$/i', $string)) {
88
-            $file = "/" . substr(md5($string), 0, 8) . "$cache.js";
88
+            $file = "/".substr(md5($string), 0, 8)."$cache.js";
89 89
             $htmlBase = "js";
90 90
         } elseif (preg_match("/image/i", $mime)) {
91 91
             $htmlBase = "img";
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
             $file = $name;
100 100
         }
101 101
         if ($debug) {
102
-            $file = str_replace("." . $extension, "_" . $originalFilename, $file);
102
+            $file = str_replace(".".$extension, "_".$originalFilename, $file);
103 103
         }
104
-        $filePath = $htmlBase . $file;
104
+        $filePath = $htmlBase.$file;
105 105
 
106 106
         return array($base, $htmlBase, $filePath);
107 107
     }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     {
117 117
         GeneratorHelper::createDir(dirname($path));
118 118
         if ("" !== $content && false === file_put_contents($path, $content)) {
119
-            throw new ConfigException(t('No se tienen permisos para escribir en ' . $path));
119
+            throw new ConfigException(t('No se tienen permisos para escribir en '.$path));
120 120
         }
121 121
     }
122 122
 }
Please login to merge, or discard this patch.