Skip to content

Commit c4e56cd

Browse files
committed
update some coments and param type
1 parent 945f29c commit c4e56cd

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/Helper/PhpHelper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public static function newMemoryStream(string $mode = 'rwb')
116116
* get $_SERVER value
117117
*
118118
* @param string $name
119-
* @param string $default
119+
* @param string|mixed $default
120120
*
121121
* @return mixed
122122
*/
@@ -192,7 +192,7 @@ public static function initObject($object, array $options)
192192
*
193193
* @return array
194194
*/
195-
public static function runtime($startTime, $startMem, array $info = [], $realUsage = false): array
195+
public static function runtime(int $startTime, $startMem, array $info = [], bool $realUsage = false): array
196196
{
197197
$info['startTime'] = $startTime;
198198
$info['endTime'] = microtime(true);
@@ -202,8 +202,8 @@ public static function runtime($startTime, $startMem, array $info = [], $realUsa
202202
$info['runtime'] = number_format(($info['endTime'] - $startTime) * 1000, 3) . 'ms';
203203

204204
if ($startMem) {
205-
$startMem = array_sum(explode(' ', $startMem));
206-
$endMem = array_sum(explode(' ', $info['endMemory']));
205+
$startMem = array_sum(explode(' ', (string)$startMem));
206+
$endMem = array_sum(explode(' ', (string)$info['endMemory']));
207207

208208
$info['memory'] = number_format(($endMem - $startMem) / 1024, 3) . 'kb';
209209
}

src/Math.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static function abs($value): int
5454
*/
5555
public static function round($value, int $precision = 0, int $mode = PHP_ROUND_HALF_UP): float
5656
{
57-
return (float)round((float)$value, $precision, $mode);
57+
return round((float)$value, $precision, $mode);
5858
}
5959

6060
/**

src/OS.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public static function getNullDevice(): string
274274
*
275275
* @return boolean
276276
*/
277-
public static function isInteractive(int $fileDescriptor): bool
277+
public static function isInteractive($fileDescriptor): bool
278278
{
279279
return function_exists('posix_isatty') && @posix_isatty($fileDescriptor);
280280
}

src/Type.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,15 @@ final class Type
2121
{
2222
// ------ basic types ------
2323

24-
// TIPS: not in gettype returns.
25-
public const INT = 'int';
24+
public const INT = 'int'; // TIPS: not in gettype returns.
2625

2726
public const INTEGER = 'integer';
2827

2928
public const FLOAT = 'float';
3029

3130
public const DOUBLE = 'double';
3231

33-
// TIPS: not in gettype returns.
34-
public const BOOL = 'bool';
32+
public const BOOL = 'bool'; // TIPS: not in gettype returns.
3533

3634
public const BOOLEAN = 'boolean';
3735

@@ -49,10 +47,12 @@ final class Type
4947

5048
// ------ other type names ------
5149

52-
public const CALLABLE = 'callable';
50+
public const NULL = 'null';
5351

5452
public const MiXED = 'mixed';
5553

54+
public const CALLABLE = 'callable';
55+
5656
public const UNKNOWN = 'unknown type';
5757

5858
/**

0 commit comments

Comments
 (0)