@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | public function dayRange($offset = 0, $time = null) |
| 39 | 39 | { |
| 40 | 40 | null === $time && $time = time(); |
| 41 | - $y = (int) (date('Y', $time)); |
|
| 42 | - $m = (int) (date('m', $time)); |
|
| 43 | - $d = (int) (date('d', $time) + $offset); |
|
| 41 | + $y = (int)(date('Y', $time)); |
|
| 42 | + $m = (int)(date('m', $time)); |
|
| 43 | + $d = (int)(date('d', $time) + $offset); |
|
| 44 | 44 | return [ |
| 45 | 45 | mktime(0, 0, 0, $m, $d, $y), |
| 46 | 46 | mktime(23, 59, 59, $m, $d, $y), |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | public function weekRange($offset = 0, $time = null) |
| 61 | 61 | { |
| 62 | 62 | null === $time && $time = time(); |
| 63 | - $offset = (int) $offset; |
|
| 63 | + $offset = (int)$offset; |
|
| 64 | 64 | return [ |
| 65 | 65 | strtotime(date('Y-m-d', strtotime('Sunday ' . ($offset - 1) . ' week', $time))), |
| 66 | 66 | strtotime(date('Y-m-d', strtotime('Saturday ' . $offset . ' week', $time))) + 24 * 3600 - 1, |
@@ -78,10 +78,10 @@ discard block |
||
| 78 | 78 | public function monthRange($offset = 0, $time = null) |
| 79 | 79 | { |
| 80 | 80 | null === $time && $time = time(); |
| 81 | - $y = (int) (date('Y', $time)); |
|
| 82 | - $m = (int) (date('m', $time) + $offset); |
|
| 81 | + $y = (int)(date('Y', $time)); |
|
| 82 | + $m = (int)(date('m', $time) + $offset); |
|
| 83 | 83 | $begin = mktime(0, 0, 0, $m, 1, $y); |
| 84 | - $end = mktime(23, 59, 59, $m, (int) date('t', $begin), $y); |
|
| 84 | + $end = mktime(23, 59, 59, $m, (int)date('t', $begin), $y); |
|
| 85 | 85 | |
| 86 | 86 | return [$begin, $end]; |
| 87 | 87 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | public function yearRange($offset = 0, $time = null) |
| 98 | 98 | { |
| 99 | 99 | null === $time && $time = time(); |
| 100 | - $year = (int) (date('Y', $time) + $offset); |
|
| 100 | + $year = (int)(date('Y', $time) + $offset); |
|
| 101 | 101 | return [ |
| 102 | 102 | mktime(0, 0, 0, 1, 1, $year), |
| 103 | 103 | mktime(23, 59, 59, 12, 31, $year), |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | public function day($offset = 0, $time = null) |
| 116 | 116 | { |
| 117 | 117 | null === $time && $time = time(); |
| 118 | - $offset = (int) $offset; |
|
| 118 | + $offset = (int)$offset; |
|
| 119 | 119 | return $time + 3600 * 24 * $offset; |
| 120 | 120 | } |
| 121 | 121 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | public function week($offset = 0, $time = null) |
| 131 | 131 | { |
| 132 | 132 | null === $time && $time = time(); |
| 133 | - $offset = (int) $offset; |
|
| 133 | + $offset = (int)$offset; |
|
| 134 | 134 | return $time + 3600 * 24 * 7 * $offset; |
| 135 | 135 | } |
| 136 | 136 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | public function month($offset = 0, $time = null) |
| 146 | 146 | { |
| 147 | 147 | null === $time && $time = time(); |
| 148 | - $offset = (int) $offset; |
|
| 148 | + $offset = (int)$offset; |
|
| 149 | 149 | return $time + 3600 * 24 * date('t', $time) * $offset; |
| 150 | 150 | } |
| 151 | 151 | |
@@ -160,8 +160,8 @@ discard block |
||
| 160 | 160 | public function year($offset = 0, $time = null) |
| 161 | 161 | { |
| 162 | 162 | null === $time && $time = time(); |
| 163 | - $offset = (int) $offset; |
|
| 164 | - return mktime((int) date('H', $time), (int) date('i', $time), (int) date('s', $time), (int) date('m', $time), (int) date('d', $time), (int) date('Y', $time) + $offset); |
|
| 163 | + $offset = (int)$offset; |
|
| 164 | + return mktime((int)date('H', $time), (int)date('i', $time), (int)date('s', $time), (int)date('m', $time), (int)date('d', $time), (int)date('Y', $time) + $offset); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | public function isLeapYear($time = null) |
| 201 | 201 | { |
| 202 | 202 | null === $time && $time = time(); |
| 203 | - return (bool) date('L', $time); |
|
| 203 | + return (bool)date('L', $time); |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | /** |
@@ -215,6 +215,6 @@ discard block |
||
| 215 | 215 | public function yearPosition($time = null) |
| 216 | 216 | { |
| 217 | 217 | null === $time && $time = time(); |
| 218 | - return (int) date('z', $time) + 1; |
|
| 218 | + return (int)date('z', $time) + 1; |
|
| 219 | 219 | } |
| 220 | 220 | } |
@@ -201,7 +201,7 @@ |
||
| 201 | 201 | /** @scrutinizer ignore-unhandled */ @ftp_chmod($this->_conn, $mode, $subFile); |
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | - return (bool) /** @scrutinizer ignore-unhandled */ @ftp_chmod($this->_conn, $mode, $file); |
|
| 204 | + return (bool)/** @scrutinizer ignore-unhandled */ @ftp_chmod($this->_conn, $mode, $file); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /** |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | public static function stdin() |
| 152 | 152 | { |
| 153 | - return rtrim((string) fgets(\STDIN), PHP_EOL); |
|
| 153 | + return rtrim((string)fgets(\STDIN), PHP_EOL); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | $input = self::stdin(); |
| 183 | 183 | if ('' === $input) { |
| 184 | - return (string) $defaultValue; |
|
| 184 | + return (string)$defaultValue; |
|
| 185 | 185 | } |
| 186 | 186 | return $input; |
| 187 | 187 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | */ |
| 211 | 211 | public static function outputList($array) |
| 212 | 212 | { |
| 213 | - foreach($array as $string){ |
|
| 213 | + foreach ($array as $string) { |
|
| 214 | 214 | self::output($string); |
| 215 | 215 | } |
| 216 | 216 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | public static function moveCursorUp($rows = 1) |
| 243 | 243 | { |
| 244 | - echo '\033[' . (int) $rows . 'A'; |
|
| 244 | + echo '\033[' . (int)$rows . 'A'; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | /** |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | */ |
| 256 | 256 | public static function moveCursorDown($rows = 1) |
| 257 | 257 | { |
| 258 | - echo '\033[' . (int) $rows . 'B'; |
|
| 258 | + echo '\033[' . (int)$rows . 'B'; |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | /** |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | */ |
| 270 | 270 | public static function moveCursorForward($steps = 1) |
| 271 | 271 | { |
| 272 | - echo '\033[' . (int) $steps . 'C'; |
|
| 272 | + echo '\033[' . (int)$steps . 'C'; |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | /** |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | */ |
| 284 | 284 | public static function moveCursorBackward($steps = 1) |
| 285 | 285 | { |
| 286 | - echo '\033[' . (int) $steps . 'D'; |
|
| 286 | + echo '\033[' . (int)$steps . 'D'; |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | /** |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | */ |
| 296 | 296 | public static function moveCursorNextLine($lines = 1) |
| 297 | 297 | { |
| 298 | - echo '\033[' . (int) $lines . 'E'; |
|
| 298 | + echo '\033[' . (int)$lines . 'E'; |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | /** |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | */ |
| 308 | 308 | public static function moveCursorPrevLine($lines = 1) |
| 309 | 309 | { |
| 310 | - echo '\033[' . (int) $lines . 'F'; |
|
| 310 | + echo '\033[' . (int)$lines . 'F'; |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | /** |
@@ -321,9 +321,9 @@ discard block |
||
| 321 | 321 | public static function moveCursorTo($column, $row = null) |
| 322 | 322 | { |
| 323 | 323 | if ($row === null) { |
| 324 | - echo '\033[' . (int) $column . 'G'; |
|
| 324 | + echo '\033[' . (int)$column . 'G'; |
|
| 325 | 325 | } else { |
| 326 | - echo '\033[' . (int) $row . ';' . (int) $column . 'H'; |
|
| 326 | + echo '\033[' . (int)$row . ';' . (int)$column . 'H'; |
|
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | */ |
| 339 | 339 | public static function scrollUp($lines = 1) |
| 340 | 340 | { |
| 341 | - echo '\033[' . (int) $lines . 'S'; |
|
| 341 | + echo '\033[' . (int)$lines . 'S'; |
|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | /** |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | */ |
| 353 | 353 | public static function scrollDown($lines = 1) |
| 354 | 354 | { |
| 355 | - echo '\033[' . (int) $lines . 'T'; |
|
| 355 | + echo '\033[' . (int)$lines . 'T'; |
|
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | /** |