Skip to content

Interface not parsed #334

@AlessandroMinoccheri

Description

@AlessandroMinoccheri

Bug Report

Q A
BC Break no
Library Version 0.3.10
PHP version 8.2

Summary

At the moment we are not parsing interfaces

How to reproduce

namespace App\Domain;
use Doctrine\ORM\QueryBuilder;
interface BookRepositoryInterface
{
    public function getBookList(): QueryBuilder;
}

With this config:

return static function (Config $config): void {
    $mvcClassSet = ClassSet::fromDir(__DIR__.'/src');

    $rules = [];

    $rules[] = Rule::allClasses()
        ->that(new ResideInOneOfTheseNamespaces('App\Domain'))
        ->should(new NotHaveDependencyOutsideNamespace('App\Domain'))
        ->because('we want protect our domain');

    $config
        ->add($mvcClassSet, ...$rules);
};

The tool passes all the tests but shouldn't!

Expected behavior

I am expecting that an error will throw for BookRepositoryInterface class

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions