8
8
9
9
/**
10
10
* @psalm-consistent-constructor
11
+ * @phpstan-consistent-constructor
11
12
*/
12
13
class InvalidVariableNameException extends InvalidTagException implements InvalidTypedTagExceptionInterface
13
14
{
14
- final public const CODE_WITH_TYPE = 0x01 + parent ::CODE_LAST ;
15
+ final public const ERROR_CODE_WITH_TYPE = 0x01 + parent ::CODE_LAST ;
15
16
16
- final public const CODE_WITHOUT_TYPE = 0x02 + parent ::CODE_LAST ;
17
+ final public const ERROR_CODE_WITHOUT_TYPE = 0x02 + parent ::CODE_LAST ;
17
18
18
- final public const CODE_EMPTY = 0x03 + parent ::CODE_LAST ;
19
+ final public const ERROR_CODE_EMPTY = 0x03 + parent ::CODE_LAST ;
19
20
20
- final public const CODE_EMPTY_NAME = 0x04 + parent ::CODE_LAST ;
21
+ final public const ERROR_CODE_EMPTY_NAME = 0x04 + parent ::CODE_LAST ;
21
22
22
- final public const CODE_INVALID_PREFIX = 0x05 + parent ::CODE_LAST ;
23
+ final public const ERROR_CODE_INVALID_PREFIX = 0x05 + parent ::CODE_LAST ;
23
24
24
- protected const CODE_LAST = self ::CODE_INVALID_PREFIX ;
25
+ protected const CODE_LAST = self ::ERROR_CODE_INVALID_PREFIX ;
25
26
26
27
/**
27
28
* @param int<0, max> $offset
@@ -53,7 +54,7 @@ public static function fromNonTyped(\Throwable $e = null): self
53
54
{
54
55
$ message = 'Could not parse tag variable name, expected "<@tag> <$name> [<description>]" ' ;
55
56
56
- return new static ($ message , self ::CODE_WITHOUT_TYPE , $ e );
57
+ return new static ($ message , self ::ERROR_CODE_WITHOUT_TYPE , $ e );
57
58
}
58
59
59
60
/**
@@ -63,7 +64,7 @@ public static function fromTyped(TypeStatement $type, int $offset, \Throwable $e
63
64
{
64
65
$ message = 'Could not parse typed tag variable name, expected "<@tag> <type> <$name> [<description>]" ' ;
65
66
66
- return new static ($ message , self ::CODE_WITH_TYPE , $ e , $ type , $ offset );
67
+ return new static ($ message , self ::ERROR_CODE_WITH_TYPE , $ e , $ type , $ offset );
67
68
}
68
69
69
70
/**
@@ -73,7 +74,7 @@ public static function fromEmptyVariable(): self
73
74
{
74
75
$ message = 'Can not read variable name from empty value ' ;
75
76
76
- return new self ($ message , self ::CODE_EMPTY );
77
+ return new self ($ message , self ::ERROR_CODE_EMPTY );
77
78
}
78
79
79
80
/**
@@ -83,7 +84,7 @@ public static function fromEmptyVariableName(): self
83
84
{
84
85
$ message = 'Variable name cannot be empty ' ;
85
86
86
- return new self ($ message , self ::CODE_EMPTY_NAME );
87
+ return new self ($ message , self ::ERROR_CODE_EMPTY_NAME );
87
88
}
88
89
89
90
/**
@@ -93,6 +94,6 @@ public static function fromInvalidVariablePrefix(): self
93
94
{
94
95
$ message = 'The variable name must starts with the "$" character ' ;
95
96
96
- return new self ($ message , self ::CODE_INVALID_PREFIX );
97
+ return new self ($ message , self ::ERROR_CODE_INVALID_PREFIX );
97
98
}
98
99
}
0 commit comments