Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
limingxinleo committed Mar 19, 2024
1 parent c203b2f commit 45cd234
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
matrix:
os: [ ubuntu-latest ]
php-version: [ '8.1', '8.2', '8.3' ]
swoole-version: [ 'v5.0.3', 'v5.1.1', 'master' ]
swoole-version: [ 'v5.0.3', 'v5.1.2', 'master' ]
exclude:
- php-version: '8.3'
swoole-version: 'v5.0.3'
Expand All @@ -21,7 +21,7 @@ jobs:
PHP_CS_FIXER_IGNORE_ENV: 1
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion app/Constants/ErrorCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ enum ErrorCode: int implements ErrorCodeInterface
*/
case SERVER_ERROR = 500;

public function getMessage(array $translate = null): string
public function getMessage(?array $translate = null): string
{
$arguments = [];
if ($translate) {
Expand Down
2 changes: 1 addition & 1 deletion app/Constants/ErrorCodeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@

interface ErrorCodeInterface extends BackedEnum
{
public function getMessage(array $translate = null): string;
public function getMessage(?array $translate = null): string;
}
2 changes: 1 addition & 1 deletion app/Exception/BusinessException.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class BusinessException extends ServerException
{
public function __construct(ErrorCodeInterface $code, string $message = null, Throwable $previous = null)
public function __construct(ErrorCodeInterface $code, ?string $message = null, ?Throwable $previous = null)
{
if (is_null($message)) {
$message = $code->getMessage();
Expand Down
3 changes: 2 additions & 1 deletion app/Kernel/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
use Hyperf\AsyncQueue\JobInterface;
use Hyperf\Context\ApplicationContext;
use Hyperf\ExceptionHandler\Formatter\FormatterInterface;
use Psr\Container\ContainerInterface;

if (! function_exists('di')) {
/**
* Finds an entry of the container by its identifier and returns it.
* @return mixed|\Psr\Container\ContainerInterface
* @return ContainerInterface|mixed
*/
function di(?string $id = null)
{
Expand Down

0 comments on commit 45cd234

Please sign in to comment.