Skip to content

Commit

Permalink
Add double quote for the constant annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
BadJacky committed Mar 23, 2024
1 parent bc787a1 commit 80d0a61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Exceptions/ConstantException.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function getErrorMessage(int $code): string

private static function parseAnnotationsFromDocComment($docComment): array
{
$pattern = '/@(\w+)\((\d+|[^\)]+)\)/';
$pattern = '/@(\w+)\((".*"|[^)]+)\)/';
preg_match_all($pattern, $docComment, $matches, PREG_SET_ORDER);
$parsed_annotations = [];
foreach ($matches as $match) {
Expand Down
2 changes: 1 addition & 1 deletion src/stubs/constant.stub
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use EverForge\ThinkConstant\Constant;
class {%className%} extends Constant
{
/**
* @Message(失败)
* @Message("失败")
*/
public const SERVER_ERROR = 500;
}

0 comments on commit 80d0a61

Please sign in to comment.