@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | /** |
93 | 93 | * Request URL. |
94 | 94 | */ |
95 | - $this->url = '/' . $url; |
|
95 | + $this->url = '/'.$url; |
|
96 | 96 | |
97 | 97 | /** |
98 | 98 | * Get method. |
@@ -129,20 +129,20 @@ discard block |
||
129 | 129 | $controller = ''; |
130 | 130 | if (false !== strpos($this->url, '.php')) { |
131 | 131 | $controller = explode('.php', $this->url); |
132 | - $controller = ltrim($controller[0], '/') . '.php'; |
|
132 | + $controller = ltrim($controller[0], '/').'.php'; |
|
133 | 133 | } |
134 | 134 | $route = trim($route, '/'); |
135 | 135 | if ('Original' == $this->package) { |
136 | 136 | if ($this->languageCode != $this->languageDefault) { |
137 | - $url = trim('/' . $this->languageCode . '/' . $route, '/'); |
|
137 | + $url = trim('/'.$this->languageCode.'/'.$route, '/'); |
|
138 | 138 | } else { |
139 | - $url = trim('/' . $route, '/'); |
|
139 | + $url = trim('/'.$route, '/'); |
|
140 | 140 | } |
141 | 141 | } else { |
142 | 142 | if ($this->languageCode != $this->languageDefault) { |
143 | - $url = trim('/' . $this->languageCode . '/' . lcfirst($this->package) . '/' . $route, '/'); |
|
143 | + $url = trim('/'.$this->languageCode.'/'.lcfirst($this->package).'/'.$route, '/'); |
|
144 | 144 | } else { |
145 | - $url = trim('/' . lcfirst($this->package) . '/' . $route, '/'); |
|
145 | + $url = trim('/'.lcfirst($this->package).'/'.$route, '/'); |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | if ($domain) { |
@@ -157,22 +157,22 @@ discard block |
||
157 | 157 | (isset($_SERVER['SERVER_PORT']) && 443 == $_SERVER['SERVER_PORT']) |
158 | 158 | ) { |
159 | 159 | if (empty($controller)) { |
160 | - $url = 'https://' . $host . '/' . $url; |
|
160 | + $url = 'https://'.$host.'/'.$url; |
|
161 | 161 | } else { |
162 | - $url = 'https://' . $host . '/' . $controller . '/' . $url; |
|
162 | + $url = 'https://'.$host.'/'.$controller.'/'.$url; |
|
163 | 163 | } |
164 | 164 | } else { |
165 | 165 | if (empty($controller)) { |
166 | - $url = 'http://' . $host . '/' . $url; |
|
166 | + $url = 'http://'.$host.'/'.$url; |
|
167 | 167 | } else { |
168 | - $url = 'http://' . $host . '/' . $controller . '/' . $url; |
|
168 | + $url = 'http://'.$host.'/'.$controller.'/'.$url; |
|
169 | 169 | } |
170 | 170 | } |
171 | 171 | } else { |
172 | 172 | if (empty($controller)) { |
173 | - $url = '/' . $url; |
|
173 | + $url = '/'.$url; |
|
174 | 174 | } else { |
175 | - $url = '/' . $controller . '/' . $url; |
|
175 | + $url = '/'.$controller.'/'.$url; |
|
176 | 176 | } |
177 | 177 | } |
178 | 178 |
@@ -3,11 +3,11 @@ |
||
3 | 3 | * Autoload without composer. |
4 | 4 | */ |
5 | 5 | $srcRoot = dirname(__FILE__); |
6 | -spl_autoload_register(function ($path) use ($srcRoot) { |
|
7 | - $root = rtrim($srcRoot, '/') . '/'; |
|
6 | +spl_autoload_register(function($path) use ($srcRoot) { |
|
7 | + $root = rtrim($srcRoot, '/').'/'; |
|
8 | 8 | $path = str_replace('Dspbee\\Test\\', '', $path); |
9 | 9 | $path = str_replace('Dspbee\\', '', $path); |
10 | - $path = $root . $path . '.php'; |
|
10 | + $path = $root.$path.'.php'; |
|
11 | 11 | if (file_exists($path)) { |
12 | 12 | require_once $path; |
13 | 13 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | if (isset($_SERVER[$key])) { |
59 | 59 | return $_SERVER[$key]; |
60 | 60 | } else { |
61 | - $key = 'HTTP_' . $key; |
|
61 | + $key = 'HTTP_'.$key; |
|
62 | 62 | return $_SERVER[$key] ?? $default; |
63 | 63 | } |
64 | 64 | } |
@@ -78,7 +78,7 @@ |
||
78 | 78 | |
79 | 79 | // PHP_AUTH_USER/PHP_AUTH_PW |
80 | 80 | if (isset($headers['PHP_AUTH_USER'])) { |
81 | - $headers['AUTHORIZATION'] = 'Basic ' . base64_encode($headers['PHP_AUTH_USER'] . ':' . $headers['PHP_AUTH_PW']); |
|
81 | + $headers['AUTHORIZATION'] = 'Basic '.base64_encode($headers['PHP_AUTH_USER'].':'.$headers['PHP_AUTH_PW']); |
|
82 | 82 | } elseif (isset($headers['PHP_AUTH_DIGEST'])) { |
83 | 83 | $headers['AUTHORIZATION'] = $headers['PHP_AUTH_DIGEST']; |
84 | 84 | } |
@@ -87,7 +87,7 @@ |
||
87 | 87 | throw new FileException(sprintf('Unable to write in the "%s" directory', $directory)); |
88 | 88 | } |
89 | 89 | |
90 | - $target = rtrim($directory, '/\\') . DIRECTORY_SEPARATOR . (null === $name ? $this->getBasename() : $this->getName($name)); |
|
90 | + $target = rtrim($directory, '/\\').DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name)); |
|
91 | 91 | |
92 | 92 | return new self($target, false); |
93 | 93 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | throw new FileException(sprintf('Could not rename the file "%s" (%s)', $this->getPathname(), strip_tags($error['message']))); |
49 | 49 | } |
50 | 50 | |
51 | - $this->customChmod($target); |
|
51 | + $this->customChmod($target); |
|
52 | 52 | |
53 | 53 | return $target; |
54 | 54 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | if ($handle = opendir($root)) { |
23 | 23 | while (false !== ($entry = readdir($handle))) { |
24 | 24 | if ($entry != "." && $entry != "..") { |
25 | - $path = $root . '/' . $entry . '/view/cache'; |
|
25 | + $path = $root.'/'.$entry.'/view/cache'; |
|
26 | 26 | if (file_exists($path)) { |
27 | 27 | self::removeFromDir($path); |
28 | 28 | } |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | $objects = scandir($dir); |
44 | 44 | foreach ($objects as $object) { |
45 | 45 | if ('.' != $object && '..' != $object) { |
46 | - if ('dir' == filetype($dir . '/' .$object)) { |
|
47 | - self::removeFromDir($dir . '/' . $object, true); |
|
46 | + if ('dir' == filetype($dir.'/'.$object)) { |
|
47 | + self::removeFromDir($dir.'/'.$object, true); |
|
48 | 48 | } else { |
49 | - unlink($dir . '/' . $object); |
|
49 | + unlink($dir.'/'.$object); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | public function initFromArray(array $data) |
22 | 22 | { |
23 | 23 | foreach ($data as $name => $value) { |
24 | - $method = 'set' . ucfirst($name); |
|
24 | + $method = 'set'.ucfirst($name); |
|
25 | 25 | if (method_exists($this, $method)) { |
26 | 26 | call_user_func_array([$this, $method], [$value]); |
27 | 27 | } else { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function getContent($name, array $data = []) |
44 | 44 | { |
45 | - $path = $this->packageRoot . '/view/_cache/' . str_replace('/', '_', $name); |
|
45 | + $path = $this->packageRoot.'/view/_cache/'.str_replace('/', '_', $name); |
|
46 | 46 | |
47 | 47 | if (!file_exists($path) || !$this->cache) { |
48 | 48 | $code = $this->compile($name, true, true); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function clearCache() |
81 | 81 | { |
82 | - $this->removeFromDir($this->packageRoot . '/view/_cache'); |
|
82 | + $this->removeFromDir($this->packageRoot.'/view/_cache'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | private function compile($name, $processInclude, $processExtends) |
97 | 97 | { |
98 | 98 | $code = null; |
99 | - $path = $this->packageRoot . '/view/' . $name; |
|
99 | + $path = $this->packageRoot.'/view/'.$name; |
|
100 | 100 | |
101 | 101 | if (file_exists($path)) { |
102 | 102 | ob_start(); |
@@ -162,10 +162,10 @@ discard block |
||
162 | 162 | $objects = scandir($dir); |
163 | 163 | foreach ($objects as $object) { |
164 | 164 | if ('.' != $object && '..' != $object) { |
165 | - if ('dir' == filetype($dir . '/' .$object)) { |
|
166 | - $this->removeFromDir($dir . '/' . $object, true); |
|
165 | + if ('dir' == filetype($dir.'/'.$object)) { |
|
166 | + $this->removeFromDir($dir.'/'.$object, true); |
|
167 | 167 | } else { |
168 | - unlink($dir . '/' . $object); |
|
168 | + unlink($dir.'/'.$object); |
|
169 | 169 | } |
170 | 170 | } |
171 | 171 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public static function handleFatal() |
46 | 46 | { |
47 | 47 | $error = error_get_last(); |
48 | - if(null !== $error) { |
|
48 | + if (null !== $error) { |
|
49 | 49 | self::render($error["type"], $error["message"], $error["file"], $error["line"]); |
50 | 50 | } |
51 | 51 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | - $template = new Native(dirname(__FILE__) . '/', null, true); |
|
92 | + $template = new Native(dirname(__FILE__).'/', null, true); |
|
93 | 93 | $response = new Response(); |
94 | 94 | $response->headerStatus(418); |
95 | 95 | $response->setContent($template->getContent('catch.html.php', $data)); |