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

Commit 7b1b8be

Browse files
committed
add more return type declare
1 parent 3a78a3b commit 7b1b8be

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/AutoLoader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class AutoLoader
6666
/**
6767
* @return self
6868
*/
69-
public static function getLoader()
69+
public static function getLoader(): self
7070
{
7171
if (null !== self::$loader) {
7272
return self::$loader;

src/PhpError.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class PhpError
2323
* @param null|string $catcher
2424
* @return array
2525
*/
26-
public static function toArray(array $lastError, $catcher = null)
26+
public static function toArray(array $lastError, $catcher = null): array
2727
{
2828
$digest = 'Fatal Error (' . self::codeToString($lastError['type']) . '): ' . $lastError['message'];
2929
$data = [
@@ -45,7 +45,7 @@ public static function toArray(array $lastError, $catcher = null)
4545
* @param int $code
4646
* @return string
4747
*/
48-
public static function codeToString(int $code)
48+
public static function codeToString(int $code): string
4949
{
5050
switch ($code) {
5151
case E_ERROR:

src/PhpException.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static function toHtml($e, $getTrace = true, $catcher = null, $clearHtml
5858
* @param null|string $catcher
5959
* @return array
6060
*/
61-
public static function toArray($e, $getTrace = true, $catcher = null)
61+
public static function toArray($e, $getTrace = true, $catcher = null): array
6262
{
6363
$data = [
6464
'class' => \get_class($e),
@@ -85,7 +85,7 @@ public static function toArray($e, $getTrace = true, $catcher = null)
8585
* @param null|string $catcher
8686
* @return string the string representation of the exception.
8787
*/
88-
public static function toJson($e, $getTrace = true, $catcher = null)
88+
public static function toJson($e, $getTrace = true, $catcher = null): string
8989
{
9090
if (!$getTrace) {
9191
$message = json_encode(['msg' => "Error: {$e->getMessage()}"]);

src/PhpHelper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static function callByArray(callable $cb, array $args)
5959
* @param bool $realUsage
6060
* @return array
6161
*/
62-
public static function runtime($startTime, $startMem, array $info = [], $realUsage = false)
62+
public static function runtime($startTime, $startMem, array $info = [], $realUsage = false): array
6363
{
6464
$info['startTime'] = $startTime;
6565
$info['endTime'] = microtime(true);

0 commit comments

Comments
 (0)