@@ -69,7 +69,7 @@ |
||
69 | 69 | * @param string $name |
70 | 70 | * @return RouteMatcher|null |
71 | 71 | */ |
72 | - public function get(string $name):?RouteMatcher |
|
72 | + public function get(string $name): ?RouteMatcher |
|
73 | 73 | { |
74 | 74 | return $this->collection[$name] ?? null; |
75 | 75 | } |
@@ -10,13 +10,13 @@ |
||
10 | 10 | { |
11 | 11 | public function log($level, string $message, array $context = []) |
12 | 12 | { |
13 | - print date('Y-m-d H:i:s') .' ' . $this->interpolate($message, $context) . PHP_EOL; |
|
13 | + print date('Y-m-d H:i:s').' '.$this->interpolate($message, $context).PHP_EOL; |
|
14 | 14 | } |
15 | 15 | public function interpolate(string $message, array $context) |
16 | 16 | { |
17 | 17 | $replace = []; |
18 | 18 | foreach ($context as $key => $val) { |
19 | - $replace['{' . $key . '}'] = $val; |
|
19 | + $replace['{'.$key.'}'] = $val; |
|
20 | 20 | } |
21 | 21 | return strtr($message, $replace); |
22 | 22 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace suda\framework\debug; |
3 | 3 | |
4 | -interface ConfigInterface { |
|
4 | +interface ConfigInterface { |
|
5 | 5 | public function applyConfig(array $config); |
6 | 6 | } |
@@ -6,10 +6,10 @@ |
||
6 | 6 | trait LoaderAwareTrait |
7 | 7 | { |
8 | 8 | /** |
9 | - * 加载器 |
|
10 | - * |
|
11 | - * @var Loader |
|
12 | - */ |
|
9 | + * 加载器 |
|
10 | + * |
|
11 | + * @var Loader |
|
12 | + */ |
|
13 | 13 | protected $loader; |
14 | 14 | |
15 | 15 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function getScheme():string |
60 | 60 | { |
61 | - return $this->isSecure()?'https':'http'; |
|
61 | + return $this->isSecure() ? 'https' : 'http'; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | * |
107 | 107 | * @return array|null |
108 | 108 | */ |
109 | - public function json():?array |
|
109 | + public function json(): ?array |
|
110 | 110 | { |
111 | - return $this->isJson?$this->parameter:null; |
|
111 | + return $this->isJson ? $this->parameter : null; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -13,12 +13,12 @@ discard block |
||
13 | 13 | */ |
14 | 14 | protected static $mimes = [ |
15 | 15 | # Image Type |
16 | - 'jpe' => 'image/jpeg' , |
|
17 | - 'jpeg' => 'image/jpeg' , |
|
18 | - 'jpg' => 'image/jpeg' , |
|
19 | - 'svg' => 'image/svg+xml' , |
|
20 | - 'png' => 'image/png' , |
|
21 | - 'gif' => 'image/gif' , |
|
16 | + 'jpe' => 'image/jpeg', |
|
17 | + 'jpeg' => 'image/jpeg', |
|
18 | + 'jpg' => 'image/jpeg', |
|
19 | + 'svg' => 'image/svg+xml', |
|
20 | + 'png' => 'image/png', |
|
21 | + 'gif' => 'image/gif', |
|
22 | 22 | 'ico' => 'image/x-icon', |
23 | 23 | 'webp' => 'image/webp', |
24 | 24 | |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | 'js' => 'text/javascript', |
27 | 27 | 'css' => 'text/css', |
28 | 28 | 'txt' => 'text/plain', |
29 | - 'html' => 'text/html' , |
|
30 | - 'csv' => 'text/csv' , |
|
29 | + 'html' => 'text/html', |
|
30 | + 'csv' => 'text/csv', |
|
31 | 31 | 'xml' => 'text/xml', |
32 | 32 | |
33 | 33 | # App type |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | |
40 | 40 | # Archive |
41 | 41 | 'zip' => 'application/zip', |
42 | - 'gtar' => 'application/x-gtar' , |
|
43 | - 'gz' => 'application/x-gzip' , |
|
42 | + 'gtar' => 'application/x-gtar', |
|
43 | + 'gz' => 'application/x-gzip', |
|
44 | 44 | '7z' => 'application/x-7z-compressed', |
45 | 45 | 'rar' => 'application/x-rar-compressed', |
46 | 46 |
@@ -234,7 +234,7 @@ |
||
234 | 234 | */ |
235 | 235 | public function getQuery(?string $name = null, $default = null) |
236 | 236 | { |
237 | - return $name === null ? $this->query:$this->query[$name] ?? $default; |
|
237 | + return $name === null ? $this->query : $this->query[$name] ?? $default; |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | /** |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * |
17 | 17 | * @var array |
18 | 18 | */ |
19 | - protected $namespace = [ __NAMESPACE__ ]; |
|
19 | + protected $namespace = [__NAMESPACE__]; |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * 包含路径 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public static function realName(string $name):string |
35 | 35 | { |
36 | - return str_replace(['.','/'], '\\', $name); |
|
36 | + return str_replace(['.', '/'], '\\', $name); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @param string $name |
43 | 43 | * @return string|null |
44 | 44 | */ |
45 | - public static function realPath(string $name):?string |
|
45 | + public static function realPath(string $name): ?string |
|
46 | 46 | { |
47 | 47 | return Path::format($name); |
48 | 48 | } |
@@ -70,7 +70,7 @@ |
||
70 | 70 | } |
71 | 71 | $zip = new ZipArchive; |
72 | 72 | if ($zip->open($path, ZipArchive::CHECKCONS)) { |
73 | - $unzipPath = $unpackPath.'/'. pathinfo($path, PATHINFO_FILENAME) .'-'.substr(md5_file($path), 0, 8); |
|
73 | + $unzipPath = $unpackPath.'/'.pathinfo($path, PATHINFO_FILENAME).'-'.substr(md5_file($path), 0, 8); |
|
74 | 74 | $zip->extractTo($unzipPath); |
75 | 75 | $zip->close(); |
76 | 76 | return PathResolver::resolve($unzipPath.'/module'); |