1313use FFI \Parser \Parser ;
1414use FFI \Parser \Parser \ParserExecutor ;
1515use FFI \Parser \Validator \ValidationContext ;
16- use FFI \Parser \Validator \ValidatorInterface ;
16+ use FFI \Parser \Validator \ValidatorRuleInterface ;
1717use FFI \Parser \Validator \Violation ;
1818use Phplrt \Contracts \Lexer \Exception \RuntimeExceptionInterface as LexerRuntimeExceptionInterface ;
1919use Phplrt \Contracts \Source \Exception \SourceExceptionInterface ;
@@ -295,7 +295,7 @@ public function testDeeplyNestedHeaderIsParsedQuickly(string $code, bool $isVali
295295
296296 public function testViolationsAreReportedByValidationException (): void
297297 {
298- $ parser = new Parser (validators : [self ::createIntTypeValidator ()]);
298+ $ parser = new Parser (rules : [self ::createIntTypeValidator ()]);
299299
300300 try {
301301 $ parser ->parse ("int a; \nint b; " );
@@ -314,7 +314,7 @@ public function testValidatorsAreGivenTheParsedDeclarations(): void
314314 {
315315 $ validator = self ::createRecordingValidator ();
316316
317- $ declarations = (new Parser (validators : [$ validator ]))->parse ('char a; long b; ' );
317+ $ declarations = (new Parser (rules : [$ validator ]))->parse ('char a; long b; ' );
318318
319319 self ::assertNotSame ([], $ validator ->contexts );
320320 self ::assertSame ($ declarations , $ validator ->contexts [0 ]->declarations );
@@ -324,7 +324,7 @@ public function testValidatorsAreNotRunBySyntaxCheck(): void
324324 {
325325 $ validator = self ::createRecordingValidator ();
326326
327- self ::assertTrue ((new Parser (validators : [$ validator ]))->validate ('int a; ' ));
327+ self ::assertTrue ((new Parser (rules : [$ validator ]))->validate ('int a; ' ));
328328 self ::assertSame ([], $ validator ->contexts );
329329 }
330330
@@ -333,7 +333,7 @@ public function testValidatorsAreNotRunOnSyntaxError(): void
333333 $ validator = self ::createRecordingValidator ();
334334
335335 try {
336- (new Parser (validators : [$ validator ]))->parse ('int a ' );
336+ (new Parser (rules : [$ validator ]))->parse ('int a ' );
337337 } catch (SyntaxErrorException ) {
338338 self ::assertSame ([], $ validator ->contexts );
339339
@@ -343,9 +343,9 @@ public function testValidatorsAreNotRunOnSyntaxError(): void
343343 self ::fail ('SyntaxErrorException has not been thrown ' );
344344 }
345345
346- private static function createIntTypeValidator (): ValidatorInterface
346+ private static function createIntTypeValidator (): ValidatorRuleInterface
347347 {
348- return new class implements ValidatorInterface {
348+ return new class implements ValidatorRuleInterface {
349349 public function validate (NodeInterface $ node , ValidationContext $ context ): iterable
350350 {
351351 if ($ node instanceof IntType) {
@@ -356,11 +356,11 @@ public function validate(NodeInterface $node, ValidationContext $context): itera
356356 }
357357
358358 /**
359- * @return ValidatorInterface &object{contexts: list<ValidationContext>}
359+ * @return ValidatorRuleInterface &object{contexts: list<ValidationContext>}
360360 */
361- private static function createRecordingValidator (): ValidatorInterface
361+ private static function createRecordingValidator (): ValidatorRuleInterface
362362 {
363- return new class implements ValidatorInterface {
363+ return new class implements ValidatorRuleInterface {
364364 /**
365365 * @var list<ValidationContext>
366366 */
0 commit comments