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 6d9a0b4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
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 6d9a0b4

Please sign in to comment.