@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | public function __construct($options = []) |
| 67 | 67 | { |
| 68 | 68 | $this->_c = Arrays::merge($this->_c, $options); |
| 69 | - setlocale(LC_ALL, (string) I::get($this->_c, 'locale', 'zh_CN.UTF-8')); |
|
| 69 | + setlocale(LC_ALL, (string)I::get($this->_c, 'locale', 'zh_CN.UTF-8')); |
|
| 70 | 70 | clearstatcache(); |
| 71 | 71 | } |
| 72 | 72 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | private function __file($file) |
| 94 | 94 | { |
| 95 | - return (string) I::getAlias($file); |
|
| 95 | + return (string)I::getAlias($file); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | if ($result && $info = curl_getinfo($curl)) { |
| 151 | 151 | if (200 == $info['http_code']) { |
| 152 | 152 | $this->_attributes[$hashName]['isExists'] = true; |
| 153 | - $this->_attributes[$hashName]['fileSize'] = (int) $info['download_content_length']; |
|
| 153 | + $this->_attributes[$hashName]['fileSize'] = (int)$info['download_content_length']; |
|
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | curl_close($curl); |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | if ('fsockopen' === $this->_c['loader']) { |
| 160 | 160 | $url = parse_url($fileName); |
| 161 | 161 | $host = $url['host']; |
| 162 | - $path = (string) I::get($url, 'path', '/'); |
|
| 163 | - $port = (int) I::get($url, 'port', 80); |
|
| 162 | + $path = (string)I::get($url, 'path', '/'); |
|
| 163 | + $port = (int)I::get($url, 'port', 80); |
|
| 164 | 164 | $fp = fsockopen($host, $port); |
| 165 | 165 | if (is_resource($fp)) { |
| 166 | 166 | fputs($fp, "GET {$path} HTTP/1.1\r\n"); |
@@ -169,17 +169,17 @@ discard block |
||
| 169 | 169 | while (!feof($fp)) { |
| 170 | 170 | $line = fgets($fp); |
| 171 | 171 | preg_match('/HTTP.*(\s\d{3}\s)/', $line, $arr) && $this->_attributes[$hashName]['isExists'] = true; |
| 172 | - preg_match('/Content-Length:(.*)/si', $line, $arr) && $this->_attributes[$hashName]['fileSize'] = (int) trim($arr[1]); |
|
| 172 | + preg_match('/Content-Length:(.*)/si', $line, $arr) && $this->_attributes[$hashName]['fileSize'] = (int)trim($arr[1]); |
|
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | fclose($fp); |
| 176 | 176 | return $this; |
| 177 | 177 | } |
| 178 | - if ('fopen' === $this->_c['loader'] && (bool) ini_get('allow_url_fopen')) { |
|
| 179 | - $headArray = (array) get_headers($fileName, 1); |
|
| 178 | + if ('fopen' === $this->_c['loader'] && (bool)ini_get('allow_url_fopen')) { |
|
| 179 | + $headArray = (array)get_headers($fileName, 1); |
|
| 180 | 180 | if (preg_match('/200/', $headArray[0])) { |
| 181 | 181 | $this->_attributes[$hashName]['isExists'] = true; |
| 182 | - $this->_attributes[$hashName]['fileSize'] = (int) $headArray['Content-Length']; |
|
| 182 | + $this->_attributes[$hashName]['fileSize'] = (int)$headArray['Content-Length']; |
|
| 183 | 183 | } |
| 184 | 184 | return $this; |
| 185 | 185 | } |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | public function line($fileName, $lineNumber = 0, $autoClose = false) |
| 277 | 277 | { |
| 278 | 278 | $spl = $this->spl($fileName, 'r'); |
| 279 | - $lineNumber = (int) $lineNumber; |
|
| 279 | + $lineNumber = (int)$lineNumber; |
|
| 280 | 280 | foreach ($this->linesGenerator($fileName, $autoClose) as $k => $line) { |
| 281 | 281 | if ($k === $lineNumber) { |
| 282 | 282 | $spl->rewind(); |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | */ |
| 383 | 383 | public function getFilesize($fileName) |
| 384 | 384 | { |
| 385 | - return (int) $this->attribute($fileName, 'fileSize'); |
|
| 385 | + return (int)$this->attribute($fileName, 'fileSize'); |
|
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | /** |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | */ |
| 415 | 415 | public function isFile($file) |
| 416 | 416 | { |
| 417 | - return (bool) $this->attribute($file, 'isExists'); |
|
| 417 | + return (bool)$this->attribute($file, 'isExists'); |
|
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | /** |