@@ -9,14 +9,14 @@ discard block |
||
9 | 9 | */ |
10 | 10 | class CharsetGuesser |
11 | 11 | { |
12 | - protected $gusse = ['GBK','GB2312','BIG5']; |
|
12 | + protected $gusse = ['GBK', 'GB2312', 'BIG5']; |
|
13 | 13 | protected $realPath; |
14 | 14 | protected $path; |
15 | 15 | |
16 | 16 | public function __construct(string $path, array $charset = []) |
17 | 17 | { |
18 | 18 | $this->path = $this->toAbsolutePath($path); |
19 | - $this->gusse = count($charset) > 0? $charset : $this->gusse; |
|
19 | + $this->gusse = count($charset) > 0 ? $charset : $this->gusse; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function getRealPath():string |
28 | 28 | { |
29 | - return $this->exist() ? (realpath($this->path) ?? $this->realPath): ''; |
|
29 | + return $this->exist() ? (realpath($this->path) ?? $this->realPath) : ''; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | foreach ($this->gusse as $code) { |
43 | 43 | $file = iconv('UTF-8', $code, $this->path); |
44 | - $abspath = $this->toAbsolutePath($file); |
|
44 | + $abspath = $this->toAbsolutePath($file); |
|
45 | 45 | if ($file !== false && $this->existCase($abspath)) { |
46 | 46 | $this->realPath = $abspath; |
47 | 47 | return true; |