@@ -669,8 +669,8 @@ class test implements Order
669669
670670 $ violations = new Violations ();
671671
672- $ notHaveDependencyOutsideNamespace = new Implement ('Foo\Order ' );
673- $ notHaveDependencyOutsideNamespace ->evaluate ($ cd [0 ], $ violations , 'we want to add this rule for our software ' );
672+ $ implement = new Implement ('Foo\Order ' );
673+ $ implement ->evaluate ($ cd [0 ], $ violations , 'we want to add this rule for our software ' );
674674
675675 $ this ->assertCount (0 , $ violations , $ violations ->toString ());
676676 }
@@ -704,4 +704,30 @@ class ApplicationLevelDto
704704
705705 $ this ->assertCount (1 , $ violations );
706706 }
707+
708+ public function test_it_parse_interfaces (): void
709+ {
710+ $ code = <<< 'EOF'
711+ <?php
712+ namespace MyProject\AppBundle\Application;
713+ use Doctrine\ORM\QueryBuilder;
714+ interface BookRepositoryInterface
715+ {
716+ public function getBookList(): QueryBuilder;
717+ }
718+ EOF;
719+
720+ /** @var FileParser $fp */
721+ $ fp = FileParserFactory::createFileParser (TargetPhpVersion::create ('8.1 ' ));
722+ $ fp ->parse ($ code , 'relativePathName ' );
723+
724+ $ cd = $ fp ->getClassDescriptions ();
725+
726+ $ violations = new Violations ();
727+
728+ $ dependsOnTheseNamespaces = new DependsOnlyOnTheseNamespaces ('MyProject\AppBundle\Application ' );
729+ $ dependsOnTheseNamespaces ->evaluate ($ cd [0 ], $ violations , 'we want to add this rule for our software ' );
730+
731+ $ this ->assertCount (1 , $ violations );
732+ }
707733}
0 commit comments