@@ -66,9 +66,9 @@ public function serialize($value): string
66
66
{
67
67
$ stringValue = assertString ($ value , InvariantViolation::class);
68
68
69
- if (!$ this -> matchesRegex ($ stringValue )) {
69
+ if (!static :: matchesRegex ($ stringValue )) {
70
70
throw new InvariantViolation (
71
- $ this -> unmatchedRegexMessage ($ stringValue )
71
+ static :: unmatchedRegexMessage ($ stringValue )
72
72
);
73
73
}
74
74
@@ -80,7 +80,7 @@ public function serialize($value): string
80
80
*
81
81
* @return bool
82
82
*/
83
- protected function matchesRegex (string $ value ): bool
83
+ protected static function matchesRegex (string $ value ): bool
84
84
{
85
85
return RegexValidator::match (
86
86
static ::regex (),
@@ -101,9 +101,9 @@ public function parseValue($value): string
101
101
{
102
102
$ stringValue = assertString ($ value , Error::class);
103
103
104
- if (!$ this -> matchesRegex ($ stringValue )) {
104
+ if (!static :: matchesRegex ($ stringValue )) {
105
105
throw new Error (
106
- $ this -> unmatchedRegexMessage ($ stringValue )
106
+ static :: unmatchedRegexMessage ($ stringValue )
107
107
);
108
108
}
109
109
@@ -124,9 +124,9 @@ public function parseLiteral($valueNode, array $variables = null): string
124
124
{
125
125
$ value = assertStringLiteral ($ valueNode );
126
126
127
- if (!$ this -> matchesRegex ($ value )) {
127
+ if (!static :: matchesRegex ($ value )) {
128
128
throw new Error (
129
- $ this -> unmatchedRegexMessage ($ value ),
129
+ static :: unmatchedRegexMessage ($ value ),
130
130
[$ valueNode ]
131
131
);
132
132
}
@@ -139,7 +139,7 @@ public function parseLiteral($valueNode, array $variables = null): string
139
139
*
140
140
* @return string
141
141
*/
142
- public function unmatchedRegexMessage (string $ value ): string
142
+ public static function unmatchedRegexMessage (string $ value ): string
143
143
{
144
144
$ safeValue = Utils::printSafeJson ($ value );
145
145
0 commit comments