@@ -166,8 +166,4 @@ |
||
| 166 | 166 | $local->putFileContent($file, <<<EOT |
| 167 | 167 | <?php |
| 168 | 168 | |
| 169 | -return {$array}; |
|
| 170 | - |
|
| 171 | -EOT); |
|
| 172 | - } |
|
| 173 | -} |
|
| 169 | +return {$array} |
|
| 174 | 170 | \ No newline at end of file |
@@ -166,8 +166,4 @@ |
||
| 166 | 166 | $local->putFileContent($file, <<<EOT |
| 167 | 167 | <?php |
| 168 | 168 | |
| 169 | -return {$array}; |
|
| 170 | - |
|
| 171 | -EOT); |
|
| 172 | - } |
|
| 173 | -} |
|
| 169 | +return {$array} |
|
| 174 | 170 | \ No newline at end of file |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | 'page' => $page, |
| 31 | 31 | 'pageSize' => $pageSize, |
| 32 | 32 | ]), 'data', []); |
| 33 | - $this->_toArrayCall = function ($array) { |
|
| 33 | + $this->_toArrayCall = function($array) { |
|
| 34 | 34 | return Arrays::columns($array, [ |
| 35 | 35 | 'id' => 'd_id', |
| 36 | 36 | 'name' => 'd_name', |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | 'page' => $page, |
| 59 | 59 | 'pageSize' => $pageSize, |
| 60 | 60 | ]), 'data', []); |
| 61 | - $this->_toArrayCall = function ($array) { |
|
| 61 | + $this->_toArrayCall = function($array) { |
|
| 62 | 62 | return Arrays::columns($array, [ |
| 63 | 63 | 'id' => 'd_id', |
| 64 | 64 | 'name' => 'd_name', |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $this->_result = (array)Json::get(Http::get('http://api.jinsapi.com/yingshi/getVodById', [ |
| 83 | 83 | 'd_id' => $id, |
| 84 | 84 | ]), 'data', []); |
| 85 | - $this->_toArrayCall = function ($array) { |
|
| 85 | + $this->_toArrayCall = function($array) { |
|
| 86 | 86 | return Arrays::columns($array, [ |
| 87 | 87 | 'id' => 'd_id', |
| 88 | 88 | 'name' => 'd_name', |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | public function fetchCitys($provinceCode = null) |
| 38 | 38 | { |
| 39 | 39 | $this->_result = (array)Json::decode(Http::get('http://www.nmc.cn/f/rest/province/' . $provinceCode)); |
| 40 | - $this->_toArrayCall = function ($array) { |
|
| 40 | + $this->_toArrayCall = function($array) { |
|
| 41 | 41 | return Arrays::columns($array, ['code', 'city', 'province']); |
| 42 | 42 | }; |
| 43 | 43 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | public function fetchWeather($cityId) |
| 71 | 71 | { |
| 72 | 72 | $this->_result = (array)Json::decode(Http::get('http://www.nmc.cn/f/rest/real/' . $cityId)); |
| 73 | - $this->_toArrayCall = function ($array) { |
|
| 73 | + $this->_toArrayCall = function($array) { |
|
| 74 | 74 | return Arrays::columns($array, [ |
| 75 | 75 | 'publish_time', |
| 76 | 76 | 'airpressure' => 'weather.airpressure', |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | public function fetchAirQuality($cityId) |
| 105 | 105 | { |
| 106 | 106 | $this->_result = (array)Json::decode(Http::get('http://www.nmc.cn/f/rest/aqi/' . $cityId)); |
| 107 | - $this->_toArrayCall = function ($array) { |
|
| 107 | + $this->_toArrayCall = function($array) { |
|
| 108 | 108 | return Arrays::columns($array, [ |
| 109 | 109 | 'forecasttime', |
| 110 | 110 | 'aq', |
@@ -129,9 +129,9 @@ discard block |
||
| 129 | 129 | * |
| 130 | 130 | * @return static |
| 131 | 131 | */ |
| 132 | - public function fetchToday($cityId){ |
|
| 132 | + public function fetchToday($cityId) { |
|
| 133 | 133 | $this->_result = (array)Json::decode(Http::get('http://www.nmc.cn/f/rest/passed/' . $cityId)); |
| 134 | - $this->_toArrayCall = function ($array) { |
|
| 134 | + $this->_toArrayCall = function($array) { |
|
| 135 | 135 | return Arrays::columns($array, [ |
| 136 | 136 | 'time', |
| 137 | 137 | 'humidity', |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | { |
| 124 | 124 | if (function_exists('array_column') && false === I::ini('USE_CUSTOM')) { |
| 125 | 125 | $result = array_column($array, $column, $index); |
| 126 | - if(null === $index){ |
|
| 126 | + if (null === $index) { |
|
| 127 | 127 | $result = self::combine(array_keys($array), $result); |
| 128 | 128 | } |
| 129 | 129 | return $result; |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | public static function stdin() |
| 150 | 150 | { |
| 151 | - return rtrim((string) fgets(\STDIN), PHP_EOL); |
|
| 151 | + return rtrim((string)fgets(\STDIN), PHP_EOL); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | $input = self::stdin(); |
| 181 | 181 | if ('' === $input) { |
| 182 | - return (string) $defaultValue; |
|
| 182 | + return (string)$defaultValue; |
|
| 183 | 183 | } |
| 184 | 184 | return $input; |
| 185 | 185 | } |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | public static function moveCursorUp($rows = 1) |
| 242 | 242 | { |
| 243 | - echo '\033[' . (int) $rows . 'A'; |
|
| 243 | + echo '\033[' . (int)$rows . 'A'; |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | */ |
| 255 | 255 | public static function moveCursorDown($rows = 1) |
| 256 | 256 | { |
| 257 | - echo '\033[' . (int) $rows . 'B'; |
|
| 257 | + echo '\033[' . (int)$rows . 'B'; |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | /** |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | */ |
| 269 | 269 | public static function moveCursorForward($steps = 1) |
| 270 | 270 | { |
| 271 | - echo '\033[' . (int) $steps . 'C'; |
|
| 271 | + echo '\033[' . (int)$steps . 'C'; |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | /** |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | */ |
| 283 | 283 | public static function moveCursorBackward($steps = 1) |
| 284 | 284 | { |
| 285 | - echo '\033[' . (int) $steps . 'D'; |
|
| 285 | + echo '\033[' . (int)$steps . 'D'; |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | /** |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | */ |
| 295 | 295 | public static function moveCursorNextLine($lines = 1) |
| 296 | 296 | { |
| 297 | - echo '\033[' . (int) $lines . 'E'; |
|
| 297 | + echo '\033[' . (int)$lines . 'E'; |
|
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | /** |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | */ |
| 307 | 307 | public static function moveCursorPrevLine($lines = 1) |
| 308 | 308 | { |
| 309 | - echo '\033[' . (int) $lines . 'F'; |
|
| 309 | + echo '\033[' . (int)$lines . 'F'; |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | /** |
@@ -320,9 +320,9 @@ discard block |
||
| 320 | 320 | public static function moveCursorTo($column, $row = null) |
| 321 | 321 | { |
| 322 | 322 | if ($row === null) { |
| 323 | - echo '\033[' . (int) $column . 'G'; |
|
| 323 | + echo '\033[' . (int)$column . 'G'; |
|
| 324 | 324 | } else { |
| 325 | - echo '\033[' . (int) $row . ';' . (int) $column . 'H'; |
|
| 325 | + echo '\033[' . (int)$row . ';' . (int)$column . 'H'; |
|
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | */ |
| 338 | 338 | public static function scrollUp($lines = 1) |
| 339 | 339 | { |
| 340 | - echo '\033[' . (int) $lines . 'S'; |
|
| 340 | + echo '\033[' . (int)$lines . 'S'; |
|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | /** |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | */ |
| 352 | 352 | public static function scrollDown($lines = 1) |
| 353 | 353 | { |
| 354 | - echo '\033[' . (int) $lines . 'T'; |
|
| 354 | + echo '\033[' . (int)$lines . 'T'; |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | /** |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | return false; |
| 526 | 526 | } |
| 527 | 527 | return $process->getOutput(); |
| 528 | - }else{ |
|
| 528 | + } else { |
|
| 529 | 529 | return exec($command); |
| 530 | 530 | } |
| 531 | 531 | } |
@@ -525,7 +525,7 @@ |
||
| 525 | 525 | return false; |
| 526 | 526 | } |
| 527 | 527 | return $process->getOutput(); |
| 528 | - }else{ |
|
| 528 | + } else{ |
|
| 529 | 529 | return exec($command); |
| 530 | 530 | } |
| 531 | 531 | } |