phpstan-phpunit icon indicating copy to clipboard operation
phpstan-phpunit copied to clipboard

Rule to enforce class naming

Open aivchen opened this issue 6 months ago • 2 comments

Continuation of #214

What if we introduce optional path parameter to phpunit.xml in the same manner as containerXmlPath in phpstan/phpstan-symfony package? Then we can analyse suffix option for each directory and check all class names.

aivchen avatar May 16 '25 12:05 aivchen

Isn't this something that https://github.com/shipmonk-rnd/dead-code-detector could take care of once it can detect unused classes? https://github.com/shipmonk-rnd/dead-code-detector

ondrejmirtes avatar May 16 '25 12:05 ondrejmirtes

Well, maybe. We can look at this problem from different angles. We can think that some class is unused. But we also can think that some class has a wrong name.

Also we can interpret "unused class" in different ways. What if some test class with wrong name referenced by another class? Is it used or not then?

aivchen avatar May 16 '25 19:05 aivchen