Test Failed
Push — master ( 026383...550f5a )
by Fran
13:48 queued 16s
created
src/functions.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -35,16 +35,16 @@  discard block
 block discarded – undo
35 35
     {
36 36
         $html = '<style>*{margin: 0} body{background: rgb(36,36,36); padding: 5px;}</style>';
37 37
         $html .= '<pre style="padding: 10px; margin: 5px; display: block; background: rgb(41,41,41); color: white; border-radius: 5px;">';
38
-        if(is_null($var)) {
39
-            if($varName) $html .= $varName . ' ==> <b>NULL</b>';
40
-        } else {
41
-            $html .= print_r('(' . gettype($var) . ') ', TRUE);
42
-            if($varName) $html .= $varName . ' ==> ';
43
-            if("boolean" === gettype($var)) {
38
+        if (is_null($var)) {
39
+            if ($varName) $html .= $varName.' ==> <b>NULL</b>';
40
+        }else {
41
+            $html .= print_r('('.gettype($var).') ', TRUE);
42
+            if ($varName) $html .= $varName.' ==> ';
43
+            if ("boolean" === gettype($var)) {
44 44
                 $html .= print_r($var ? "TRUE" : "FALSE", TRUE);
45
-            } else if((is_array($var) && !empty($var)) || (!is_array($var)) ||  ($var === 0)) {
45
+            }else if ((is_array($var) && !empty($var)) || (!is_array($var)) || ($var === 0)) {
46 46
                 $html .= print_r($var, TRUE);
47
-            } else {
47
+            }else {
48 48
                 $html .= 'empty';
49 49
             }
50 50
         }
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
     /* @var $file SplFileInfo */
80 80
     foreach ($finder as $file) {
81 81
         $path = $file->getRealPath();
82
-        if(!in_array($path, $loaded_files)) {
82
+        if (!in_array($path, $loaded_files)) {
83 83
             $loaded_files[] = $path;
84 84
             require_once($path);
85 85
         }
86 86
     }
87 87
 }
88 88
 
89
-if(!function_exists('t')) {
89
+if (!function_exists('t')) {
90 90
     function t($message, $key = null, $reload = false) {
91 91
         return CustomTranslateExtension::_($message, $key, $reload);
92 92
     }
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,10 +36,14 @@  discard block
 block discarded – undo
36 36
         $html = '<style>*{margin: 0} body{background: rgb(36,36,36); padding: 5px;}</style>';
37 37
         $html .= '<pre style="padding: 10px; margin: 5px; display: block; background: rgb(41,41,41); color: white; border-radius: 5px;">';
38 38
         if(is_null($var)) {
39
-            if($varName) $html .= $varName . ' ==> <b>NULL</b>';
39
+            if($varName) {
40
+                $html .= $varName . ' ==> <b>NULL</b>';
41
+            }
40 42
         } else {
41 43
             $html .= print_r('(' . gettype($var) . ') ', TRUE);
42
-            if($varName) $html .= $varName . ' ==> ';
44
+            if($varName) {
45
+                $html .= $varName . ' ==> ';
46
+            }
43 47
             if("boolean" === gettype($var)) {
44 48
                 $html .= print_r($var ? "TRUE" : "FALSE", TRUE);
45 49
             } else if((is_array($var) && !empty($var)) || (!is_array($var)) ||  ($var === 0)) {
@@ -63,9 +67,10 @@  discard block
 block discarded – undo
63 67
     function getallheaders()
64 68
     {
65 69
         $headers = [];
66
-        foreach ($_SERVER as $h => $v)
67
-            if (preg_match('/HTTP_(.+)/', $h, $hp)) {
70
+        foreach ($_SERVER as $h => $v) {
71
+                    if (preg_match('/HTTP_(.+)/', $h, $hp)) {
68 72
                 $headers[$hp[1]] = $v;
73
+        }
69 74
             }
70 75
         return $headers;
71 76
     }
Please login to merge, or discard this patch.
src/base/types/traits/Helper/ServerTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     public function getServer($key, $default = null)
22 22
     {
23 23
         $value = null;
24
-        if(array_key_exists($key, $this->server)) {
24
+        if (array_key_exists($key, $this->server)) {
25 25
             $value = $this->server[$key];
26 26
         }
27 27
         return $value ?: $default;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function getProtocol()
62 62
     {
63
-        if(Config::getParam('force.https', false)) {
63
+        if (Config::getParam('force.https', false)) {
64 64
             return 'https://';
65 65
         }
66 66
         return ($this->getServer('HTTPS') || $this->getServer('https')) ? 'https://' : 'http://';
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
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     {
35 35
         $platform = trim(Config::getInstance()->get('platform.name', 'PSFS'));
36 36
         header('HTTP/1.1 401 Unauthorized');
37
-        header('WWW-Authenticate: Basic Realm="' . $platform . '"');
37
+        header('WWW-Authenticate: Basic Realm="'.$platform.'"');
38 38
         echo t('Zona restringida');
39 39
         exit();
40 40
     }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                             $admin['class'] = 'primary';
77 77
                             break;
78 78
                     }
79
-                } else {
79
+                }else {
80 80
                     $admin['class'] = 'primary';
81 81
                 }
82 82
             }
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
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     {
89 89
         $headers = [];
90 90
         foreach ($this->getHeaders() as $key => $value) {
91
-            $headers[] = $key . ': ' . $value;
91
+            $headers[] = $key.': '.$value;
92 92
         }
93 93
         $headers[self::PSFS_TRACK_HEADER] = Logger::getUid();
94 94
         if (count($headers)) {
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             case Request::VERB_GET:
119 119
                 if (!empty($this->params)) {
120 120
                     $sep = !str_contains($this->getUrl(), '?') ? '?' : '';
121
-                    $this->setUrl($this->getUrl() . $sep . http_build_query($this->getParams()), false);
121
+                    $this->setUrl($this->getUrl().$sep.http_build_query($this->getParams()), false);
122 122
                 }
123 123
                 break;
124 124
             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->getRawResult()) ? $this->getRawResult() : [$this->getRawResult()]);
152
+        Logger::log($this->getUrl().' response: ', LOG_DEBUG, is_array($this->getRawResult()) ? $this->getRawResult() : [$this->getRawResult()]);
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/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($isOdd = null)
94 94
     {
95 95
         $timestamp = time();
96
-        $tsIsOdd = (bool)((int)substr($timestamp, -1) % 2);
96
+        $tsIsOdd = (bool)((int)substr($timestamp, -1)%2);
97 97
         if (false === $isOdd && !$tsIsOdd) {
98 98
             $timestamp--;
99 99
         } elseif (true === $isOdd && !$tsIsOdd) {
@@ -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   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
             $objects = scandir($dir);
24 24
             foreach ($objects as $object) {
25 25
                 if ($object != "." && $object != "..") {
26
-                    if (filetype($dir . "/" . $object) == "dir") {
27
-                        self::deleteDir($dir . "/" . $object);
28
-                    } else {
29
-                        unlink($dir . "/" . $object);
26
+                    if (filetype($dir."/".$object) == "dir") {
27
+                        self::deleteDir($dir."/".$object);
28
+                    }else {
29
+                        unlink($dir."/".$object);
30 30
                     }
31 31
                 }
32 32
             }
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $rootDirs = array("css", "js", "media", "font");
44 44
         foreach ($rootDirs as $dir) {
45
-            if (file_exists(WEB_DIR . DIRECTORY_SEPARATOR . $dir)) {
45
+            if (file_exists(WEB_DIR.DIRECTORY_SEPARATOR.$dir)) {
46 46
                 try {
47
-                    self::deleteDir(WEB_DIR . DIRECTORY_SEPARATOR . $dir);
48
-                } catch (\Exception $e) {
47
+                    self::deleteDir(WEB_DIR.DIRECTORY_SEPARATOR.$dir);
48
+                }catch (\Exception $e) {
49 49
                     syslog(LOG_INFO, $e->getMessage());
50 50
                 }
51 51
             }
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public static function createDir($dir)
61 61
     {
62
-        if(!empty($dir)) {
62
+        if (!empty($dir)) {
63 63
             try {
64 64
                 if (!is_dir($dir) && @mkdir($dir, 0775, true) === false) {
65
-                    throw new \Exception(t('Can\'t create directory ') . $dir);
65
+                    throw new \Exception(t('Can\'t create directory ').$dir);
66 66
                 }
67
-            } catch (\Exception $e) {
67
+            }catch (\Exception $e) {
68 68
                 syslog(LOG_WARNING, $e->getMessage());
69 69
                 if (!file_exists(dirname($dir))) {
70
-                    throw new GeneratorException($e->getMessage() . $dir);
70
+                    throw new GeneratorException($e->getMessage().$dir);
71 71
                 }
72 72
             }
73 73
         }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public static function getTemplatePath()
81 81
     {
82
-        $path = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR;
82
+        $path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR;
83 83
         return realpath($path);
84 84
     }
85 85
 
@@ -98,15 +98,15 @@  discard block
 block discarded – undo
98 98
      * @throws \ReflectionException
99 99
      */
100 100
     public static function checkCustomNamespaceApi($namespace) {
101
-        if(!empty($namespace)) {
102
-            if(class_exists($namespace)) {
101
+        if (!empty($namespace)) {
102
+            if (class_exists($namespace)) {
103 103
                 $reflector = new \ReflectionClass($namespace);
104
-                if(!$reflector->isSubclassOf(Api::class)) {
104
+                if (!$reflector->isSubclassOf(Api::class)) {
105 105
                     throw new GeneratorException(t('La clase definida debe extender de PSFS\\\base\\\types\\\Api'), 501);
106
-                } elseif(!$reflector->isAbstract()) {
106
+                } elseif (!$reflector->isAbstract()) {
107 107
                     throw new GeneratorException(t('La clase definida debe ser abstracta'), 501);
108 108
                 }
109
-            } else {
109
+            }else {
110 110
                 throw new GeneratorException(t('La clase definida para extender la API no existe'), 501);
111 111
             }
112 112
         }
@@ -120,14 +120,14 @@  discard block
 block discarded – undo
120 120
      */
121 121
     public static function createRoot($path = WEB_DIR, OutputInterface $output = null, $quiet = false) {
122 122
 
123
-        if(null === $output) {
123
+        if (null === $output) {
124 124
             $output = new ConsoleOutput();
125 125
         }
126 126
 
127 127
         GeneratorHelper::createDir($path);
128 128
         $paths = array("js", "css", "img", "media", "font");
129 129
         foreach ($paths as $htmlPath) {
130
-            GeneratorHelper::createDir($path . DIRECTORY_SEPARATOR . $htmlPath);
130
+            GeneratorHelper::createDir($path.DIRECTORY_SEPARATOR.$htmlPath);
131 131
         }
132 132
 
133 133
         // Generates the root needed files
@@ -137,26 +137,26 @@  discard block
 block discarded – undo
137 137
             'crossdomain' => 'crossdomain.xml',
138 138
             'humans' => 'humans.txt',
139 139
             'robots' => 'robots.txt',
140
-            'docker' => '..' . DIRECTORY_SEPARATOR . 'docker-compose.yml',
140
+            'docker' => '..'.DIRECTORY_SEPARATOR.'docker-compose.yml',
141 141
         ];
142 142
         $output->writeln('Start creating html files');
143 143
         foreach ($files as $templates => $filename) {
144
-            $text = Template::getInstance()->dump("generator/html/" . $templates . '.html.twig');
145
-            if (false === file_put_contents($path . DIRECTORY_SEPARATOR . $filename, $text)) {
146
-                if(!$quiet) {
147
-                    $output->writeln('Can\t create the file ' . $filename);
144
+            $text = Template::getInstance()->dump("generator/html/".$templates.'.html.twig');
145
+            if (false === file_put_contents($path.DIRECTORY_SEPARATOR.$filename, $text)) {
146
+                if (!$quiet) {
147
+                    $output->writeln('Can\t create the file '.$filename);
148 148
                 }
149
-            } else {
150
-                if(!$quiet) {
151
-                    $output->writeln($filename . ' created successfully');
149
+            }else {
150
+                if (!$quiet) {
151
+                    $output->writeln($filename.' created successfully');
152 152
                 }
153 153
             }
154 154
         }
155 155
 
156 156
         //Export base locale translations
157
-        if (!file_exists(BASE_DIR . DIRECTORY_SEPARATOR . 'locale')) {
158
-            GeneratorHelper::createDir(BASE_DIR . DIRECTORY_SEPARATOR . 'locale');
159
-            self::copyr(SOURCE_DIR . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'locale', BASE_DIR . DIRECTORY_SEPARATOR . 'locale');
157
+        if (!file_exists(BASE_DIR.DIRECTORY_SEPARATOR.'locale')) {
158
+            GeneratorHelper::createDir(BASE_DIR.DIRECTORY_SEPARATOR.'locale');
159
+            self::copyr(SOURCE_DIR.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'locale', BASE_DIR.DIRECTORY_SEPARATOR.'locale');
160 160
         }
161 161
     }
162 162
 
@@ -172,12 +172,12 @@  discard block
 block discarded – undo
172 172
     {
173 173
         if (file_exists($filenamePath)) {
174 174
             $destfolder = basename($filenamePath);
175
-            if (!file_exists(WEB_DIR . $dest . DIRECTORY_SEPARATOR . $destfolder) || $debug || $force) {
175
+            if (!file_exists(WEB_DIR.$dest.DIRECTORY_SEPARATOR.$destfolder) || $debug || $force) {
176 176
                 if (is_dir($filenamePath)) {
177
-                    self::copyr($filenamePath, WEB_DIR . $dest . DIRECTORY_SEPARATOR . $destfolder);
178
-                } else {
179
-                    if (@copy($filenamePath, WEB_DIR . $dest . DIRECTORY_SEPARATOR . $destfolder) === FALSE) {
180
-                        throw new ConfigException("Can't copy " . $filenamePath . " to " . WEB_DIR . $dest . DIRECTORY_SEPARATOR . $destfolder);
177
+                    self::copyr($filenamePath, WEB_DIR.$dest.DIRECTORY_SEPARATOR.$destfolder);
178
+                }else {
179
+                    if (@copy($filenamePath, WEB_DIR.$dest.DIRECTORY_SEPARATOR.$destfolder) === FALSE) {
180
+                        throw new ConfigException("Can't copy ".$filenamePath." to ".WEB_DIR.$dest.DIRECTORY_SEPARATOR.$destfolder);
181 181
                     }
182 182
                 }
183 183
             }
@@ -195,10 +195,10 @@  discard block
 block discarded – undo
195 195
         self::createDir($dst);
196 196
         while (false !== ($file = readdir($dir))) {
197 197
             if (($file != '.') && ($file != '..')) {
198
-                if (is_dir($src . '/' . $file)) {
199
-                    self::copyr($src . '/' . $file, $dst . '/' . $file);
200
-                } elseif (@copy($src . '/' . $file, $dst . '/' . $file) === false) {
201
-                    throw new ConfigException("Can't copy " . $src . " to " . $dst);
198
+                if (is_dir($src.'/'.$file)) {
199
+                    self::copyr($src.'/'.$file, $dst.'/'.$file);
200
+                } elseif (@copy($src.'/'.$file, $dst.'/'.$file) === false) {
201
+                    throw new ConfigException("Can't copy ".$src." to ".$dst);
202 202
                 }
203 203
             }
204 204
         }
Please login to merge, or discard this patch.
src/base/types/helpers/RouterHelper.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
     {
25 25
         Inspector::stats('[RouterHelper] Getting class to call for executing the request action', Inspector::SCOPE_DEBUG);
26 26
         Logger::log('Getting class to call for executing the request action', LOG_DEBUG, $action);
27
-        $actionClass = class_exists($action['class']) ? $action['class'] : "\\" . $action['class'];
27
+        $actionClass = class_exists($action['class']) ? $action['class'] : "\\".$action['class'];
28 28
         $reflectionClass = new ReflectionClass($actionClass);
29 29
         if ($reflectionClass->hasMethod('getInstance')) {
30 30
             $class = $reflectionClass->getMethod('getInstance')->invoke(null, $action['method']);
31
-        } else {
31
+        }else {
32 32
             $class = new $actionClass;
33 33
         }
34 34
         return $class;
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     public static function extractComponents($route, $pattern)
63 63
     {
64 64
         Inspector::stats('[RouterHelper] Extracting parts for the request to execute', Inspector::SCOPE_DEBUG);
65
-        if(Config::getParam('allow.double.slashes', true)) {
65
+        if (Config::getParam('allow.double.slashes', true)) {
66 66
             $route = preg_replace("/\/\//", '/', $route);
67 67
         }
68 68
         $url = parse_url($route);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             $cleanPatternSep--;
101 101
         }
102 102
 
103
-        if(Config::getParam('allow.double.slashes', true)) {
103
+        if (Config::getParam('allow.double.slashes', true)) {
104 104
             $path = preg_replace("/\/\//", '/', $path);
105 105
         }
106 106
         $pathSep = count(explode('/', $path));
@@ -120,14 +120,14 @@  discard block
 block discarded – undo
120 120
      */
121 121
     public static function matchRoutePattern($routePattern, $path)
122 122
     {
123
-        if(Config::getParam('allow.double.slashes', true)) {
123
+        if (Config::getParam('allow.double.slashes', true)) {
124 124
             $path = preg_replace("/\/\//", '/', $path);
125 125
         }
126 126
         $expr = preg_replace('/\{([^}]+)\}/', '%%%', $routePattern);
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, $domain)
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/traits/Generator/PropelHelperTrait.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -22,12 +22,12 @@  discard block
 block discarded – undo
22 22
      */
23 23
     private function getPropelPaths($modulePath)
24 24
     {
25
-        $moduleDir = CORE_DIR . DIRECTORY_SEPARATOR . $modulePath;
25
+        $moduleDir = CORE_DIR.DIRECTORY_SEPARATOR.$modulePath;
26 26
         GeneratorHelper::createDir($moduleDir);
27 27
         $moduleDir = realpath($moduleDir);
28
-        $configDir = $moduleDir . DIRECTORY_SEPARATOR . 'Config';
29
-        $sqlDir = $moduleDir . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR . 'Sql';
30
-        $migrationDir = $moduleDir . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR . 'Migrations';
28
+        $configDir = $moduleDir.DIRECTORY_SEPARATOR.'Config';
29
+        $sqlDir = $moduleDir.DIRECTORY_SEPARATOR.'Config'.DIRECTORY_SEPARATOR.'Sql';
30
+        $migrationDir = $moduleDir.DIRECTORY_SEPARATOR.'Config'.DIRECTORY_SEPARATOR.'Migrations';
31 31
         $paths = [
32 32
             'projectDir' => $moduleDir,
33 33
             'outputDir' => $moduleDir,
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
      * @param AbstractManager $manager
91 91
      * @param string $workingDir
92 92
      */
93
-    private function setupManager(GeneratorConfig $configGenerator, AbstractManager &$manager, $workingDir = CORE_DIR)
93
+    private function setupManager(GeneratorConfig $configGenerator, AbstractManager & $manager, $workingDir = CORE_DIR)
94 94
     {
95 95
         $manager->setGeneratorConfig($configGenerator);
96
-        $schemaFile = new \SplFileInfo($configGenerator->getSection('paths')['schemaDir'] . DIRECTORY_SEPARATOR . 'schema.xml');
96
+        $schemaFile = new \SplFileInfo($configGenerator->getSection('paths')['schemaDir'].DIRECTORY_SEPARATOR.'schema.xml');
97 97
         $manager->setSchemas([$schemaFile]);
98
-        $manager->setLoggerClosure(function ($message) {
98
+        $manager->setLoggerClosure(function($message) {
99 99
             Logger::log($message, LOG_INFO);
100 100
         });
101 101
         $manager->setWorkingDirectory($workingDir);
Please login to merge, or discard this patch.
src/base/types/traits/Helper/FieldModelHelperTrait.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $fDto->entity = $relatedModel;
32 32
         $relatedField = $foreignTable->getColumn($mappedColumn->getRelatedColumnName());
33 33
         $fDto->relatedField = $relatedField->getPhpName();
34
-        $fDto->url = Router::getInstance()->getRoute(strtolower($domain) . '-api-' . $relatedModel);
34
+        $fDto->url = Router::getInstance()->getRoute(strtolower($domain).'-api-'.$relatedModel);
35 35
         return $fDto;
36 36
     }
37 37
 
@@ -40,21 +40,21 @@  discard block
 block discarded – undo
40 40
      * @param ModelCriteria $query
41 41
      * @param mixed $value
42 42
      */
43
-    private static function addQueryFilter(ColumnMap $column, ModelCriteria &$query, $value = null)
43
+    private static function addQueryFilter(ColumnMap $column, ModelCriteria & $query, $value = null)
44 44
     {
45 45
         $tableField = $column->getFullyQualifiedName();
46
-        if(is_array($value)) {
46
+        if (is_array($value)) {
47 47
             $query->add($tableField, $value, Criteria::IN);
48 48
         } elseif (preg_match('/^\[/', $value) && preg_match('/\]$/', $value)) {
49 49
             $query->add($tableField, explode(',', preg_replace('/(\[|\])/', '', $value)), Criteria::IN);
50 50
         } elseif (preg_match('/^(\'|\")(.*)(\'|\")$/', $value)) {
51 51
             $text = preg_replace('/(\'|\")/', '', $value);
52 52
             $text = preg_replace('/\ /', '%', $text);
53
-            $query->add($tableField, '%' . $text . '%', Criteria::LIKE);
54
-        } else {
55
-            if(null !== $column->getValueSet()) {
53
+            $query->add($tableField, '%'.$text.'%', Criteria::LIKE);
54
+        }else {
55
+            if (null !== $column->getValueSet()) {
56 56
                 $valueSet = $column->getValueSet();
57
-                if(in_array($value, $valueSet)) {
57
+                if (in_array($value, $valueSet)) {
58 58
                     $value = array_search($value, $valueSet);
59 59
                 }
60 60
             }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      * @param string $field
70 70
      * @param mixed $value
71 71
      */
72
-    public static function addModelField(TableMap $tableMap, ModelCriteria &$query, $field, $value = null)
72
+    public static function addModelField(TableMap $tableMap, ModelCriteria & $query, $field, $value = null)
73 73
     {
74 74
         if ($column = self::checkFieldExists($tableMap, $field)) {
75 75
             self::addQueryFilter($column, $query, $value);
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public static function extractQuery($modelNameNamespace, ConnectionInterface $con = null)
86 86
     {
87
-        $queryReflector = new \ReflectionClass($modelNameNamespace . "Query");
87
+        $queryReflector = new \ReflectionClass($modelNameNamespace."Query");
88 88
         /** @var \Propel\Runtime\ActiveQuery\ModelCriteria $query */
89 89
         $query = $queryReflector->getMethod('create')->invoke($con);
90 90
 
@@ -97,37 +97,37 @@  discard block
 block discarded – undo
97 97
      * @param array $extraColumns
98 98
      * @param mixed $value
99 99
      */
100
-    public static function composerComboField(TableMap $tableMap, ModelCriteria &$query, array $extraColumns = [], $value = null)
100
+    public static function composerComboField(TableMap $tableMap, ModelCriteria & $query, array $extraColumns = [], $value = null)
101 101
     {
102 102
         $exp = 'CONCAT(';
103 103
         $sep = '';
104 104
         foreach ($tableMap->getColumns() as $column) {
105 105
             if ($column->isText()) {
106
-                $exp .= $sep . 'IFNULL(' . $column->getFullyQualifiedName() . ',"")';
106
+                $exp .= $sep.'IFNULL('.$column->getFullyQualifiedName().',"")';
107 107
                 $sep = ', " ", ';
108 108
             }
109 109
         }
110
-        foreach($tableMap->getRelations() as $relation) {
111
-            if(preg_match('/I18n$/i', $relation->getName())) {
110
+        foreach ($tableMap->getRelations() as $relation) {
111
+            if (preg_match('/I18n$/i', $relation->getName())) {
112 112
                 $localeTableMap = $relation->getLocalTable();
113 113
                 foreach ($localeTableMap->getColumns() as $column) {
114 114
                     if ($column->isText()) {
115
-                        $exp .= $sep . 'IFNULL(' . $column->getFullyQualifiedName() . ',"")';
115
+                        $exp .= $sep.'IFNULL('.$column->getFullyQualifiedName().',"")';
116 116
                         $sep = ', " ", ';
117 117
                     }
118 118
                 }
119 119
             }
120 120
         }
121 121
         foreach (array_keys($extraColumns) as $extra) {
122
-            if(!preg_match("/(COUNT|DISTINCT|SUM|MAX|MIN|GROUP)/i", $extra)) {
123
-                $exp .= $sep . $extra;
122
+            if (!preg_match("/(COUNT|DISTINCT|SUM|MAX|MIN|GROUP)/i", $extra)) {
123
+                $exp .= $sep.$extra;
124 124
                 $sep = ', " ", ';
125 125
             }
126 126
         }
127 127
         $exp .= ")";
128 128
         $text = preg_replace('/(\'|\")/', '', $value);
129 129
         $text = preg_replace('/\ /', '%', $text);
130
-        $query->where($exp . Criteria::LIKE . '"%' . $text . '%"');
130
+        $query->where($exp.Criteria::LIKE.'"%'.$text.'%"');
131 131
     }
132 132
 
133 133
     /**
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      */
137 137
     public static function extractPrimaryKeyColumnName(TableMap $tableMap) {
138 138
         $modelPk = null;
139
-        foreach($tableMap->getPrimaryKeys() as $pk) {
139
+        foreach ($tableMap->getPrimaryKeys() as $pk) {
140 140
             $modelPk = $pk;
141 141
             break;
142 142
         }
Please login to merge, or discard this patch.