Skip to content
This repository was archived by the owner on Apr 24, 2021. It is now read-only.

Commit c202f07

Browse files
committed
format all codes
1 parent 397caf2 commit c202f07

File tree

6 files changed

+33
-33
lines changed

6 files changed

+33
-33
lines changed

src/AutoLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,15 @@ public function addClassMap(array $classMap)
219219
*/
220220
public function register(bool $prepend = false)
221221
{
222-
\spl_autoload_register(array($this, 'loadClass'), true, $prepend);
222+
\spl_autoload_register([$this, 'loadClass'], true, $prepend);
223223
}
224224

225225
/**
226226
* Un-registers this instance as an autoloader.
227227
*/
228228
public function unRegister()
229229
{
230-
\spl_autoload_unregister(array($this, 'loadClass'));
230+
\spl_autoload_unregister([$this, 'loadClass']);
231231
}
232232

233233
/**

src/PhpEnv.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public static function hasPosix(): bool
159159
}
160160

161161
/**
162-
* @param $name
162+
* @param $name
163163
* @param bool|false $throwException
164164
* @return bool
165165
* @throws \RuntimeException
@@ -180,7 +180,7 @@ public static function extIsLoaded(string $name, $throwException = false): bool
180180
* @param array $extensions
181181
* @return array|bool
182182
*/
183-
public static function checkExtList(array $extensions = array())
183+
public static function checkExtList(array $extensions = [])
184184
{
185185
$allTotal = [];
186186

src/PhpError.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ class PhpError
1919

2020
/**
2121
* $lastError = error_get_last();
22-
* @param array $lastError
22+
* @param array $lastError
2323
* @param null|string $catcher
2424
* @return array
2525
*/
2626
public static function toArray(array $lastError, $catcher = null): array
2727
{
2828
$digest = 'Fatal Error (' . self::codeToString($lastError['type']) . '): ' . $lastError['message'];
2929
$data = [
30-
'code' => $lastError['type'],
30+
'code' => $lastError['type'],
3131
'message' => $lastError['message'],
32-
'file' => $lastError['file'],
33-
'line' => $lastError['line'],
32+
'file' => $lastError['file'],
33+
'line' => $lastError['line'],
3434
'catcher' => __METHOD__,
3535
];
3636

src/PhpException.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public static function toString($e, $getTrace = true, $catcher = null): string
2626
/**
2727
* Converts an exception into a simple string.
2828
* @param \Exception|\Throwable $e the exception being converted
29-
* @param bool $clearHtml
30-
* @param bool $getTrace
31-
* @param null|string $catcher
29+
* @param bool $clearHtml
30+
* @param bool $getTrace
31+
* @param null|string $catcher
3232
* @return string the string representation of the exception.
3333
*/
3434
public static function toHtml($e, $getTrace = true, $catcher = null, $clearHtml = false): string
@@ -54,17 +54,17 @@ public static function toHtml($e, $getTrace = true, $catcher = null, $clearHtml
5454
/**
5555
* Converts an exception into a simple array.
5656
* @param \Exception|\Throwable $e the exception being converted
57-
* @param bool $getTrace
58-
* @param null|string $catcher
57+
* @param bool $getTrace
58+
* @param null|string $catcher
5959
* @return array
6060
*/
6161
public static function toArray($e, $getTrace = true, $catcher = null): array
6262
{
6363
$data = [
64-
'class' => \get_class($e),
64+
'class' => \get_class($e),
6565
'message' => $e->getMessage(),
66-
'code' => $e->getCode(),
67-
'file' => $e->getFile() . ':' . $e->getLine(),
66+
'code' => $e->getCode(),
67+
'file' => $e->getFile() . ':' . $e->getLine(),
6868
];
6969

7070
if ($catcher) {
@@ -81,8 +81,8 @@ public static function toArray($e, $getTrace = true, $catcher = null): array
8181
/**
8282
* Converts an exception into a json string.
8383
* @param \Exception|\Throwable $e the exception being converted
84-
* @param bool $getTrace
85-
* @param null|string $catcher
84+
* @param bool $getTrace
85+
* @param null|string $catcher
8686
* @return string the string representation of the exception.
8787
*/
8888
public static function toJson($e, $getTrace = true, $catcher = null): string
@@ -92,7 +92,7 @@ public static function toJson($e, $getTrace = true, $catcher = null): string
9292
} else {
9393
$map = [
9494
'code' => $e->getCode() ?: 500,
95-
'msg' => sprintf(
95+
'msg' => sprintf(
9696
'%s(%d): %s, File: %s(Line %d)',
9797
\get_class($e),
9898
$e->getCode(),

src/PhpHelper.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static function serverParam(string $name, $default = '')
2727

2828
/**
2929
* @param callable|mixed $cb
30-
* @param array ...$args
30+
* @param array ...$args
3131
* @return mixed
3232
*/
3333
public static function call($cb, ...$args)
@@ -55,7 +55,7 @@ public static function call($cb, ...$args)
5555

5656
/**
5757
* @param callable $cb
58-
* @param array $args
58+
* @param array $args
5959
* @return mixed
6060
*/
6161
public static function callByArray(callable $cb, array $args)
@@ -93,10 +93,10 @@ public static function initObject($object, array $options)
9393

9494
/**
9595
* 获取资源消耗
96-
* @param int $startTime
96+
* @param int $startTime
9797
* @param int|float $startMem
98-
* @param array $info
99-
* @param bool $realUsage
98+
* @param array $info
99+
* @param bool $realUsage
100100
* @return array
101101
*/
102102
public static function runtime($startTime, $startMem, array $info = [], $realUsage = false): array

src/Type.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
final class Type
1616
{
1717
// php data type
18-
const INT = 'int';
19-
const INTEGER = 'integer';
20-
const FLOAT = 'float';
21-
const DOUBLE = 'double';
22-
const BOOL = 'bool';
23-
const BOOLEAN = 'boolean';
24-
const STRING = 'string';
18+
const INT = 'int';
19+
const INTEGER = 'integer';
20+
const FLOAT = 'float';
21+
const DOUBLE = 'double';
22+
const BOOL = 'bool';
23+
const BOOLEAN = 'boolean';
24+
const STRING = 'string';
2525

26-
const ARRAY = 'array';
27-
const OBJECT = 'object';
26+
const ARRAY = 'array';
27+
const OBJECT = 'object';
2828
const RESOURCE = 'resource';
2929

3030
/**

0 commit comments

Comments
 (0)