Skip to content

Commit

Permalink
Use PHP8 attributes instead of comments for ErrorCode.
Browse files Browse the repository at this point in the history
  • Loading branch information
limingxinleo committed Apr 2, 2024
1 parent 914b813 commit d737b4c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/Constants/ErrorCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@
namespace App\Constants;

use Hyperf\Constants\Annotation\Constants;
use Hyperf\Constants\Annotation\Message;
use Hyperf\Constants\EnumConstantsTrait;

#[Constants]
enum ErrorCode: int implements ErrorCodeInterface
{
use EnumConstantsTrait;

/**
* @Message("Server Error")
*/
#[Message('Server Error')]
case SERVER_ERROR = 500;

public function getMessage(?array $translate = null): string
Expand Down

0 comments on commit d737b4c

Please sign in to comment.