Skip to content

phpat archirtecture rules reported as dead code #378

Description

@staabm

phpat rules are registered in the PHPStan DI container via nette-neon with phpat.test-tag and don't see real call-sites in php code.


real world example https://github.com/infection/infection/blob/837f2860d395a411577269b98baa42272686e60e/tests/Architecture/PHPat/SrcShouldNotDependOnTestsTest.php#L42-L53

thats why they are reported as dead code

------ ------------------------------------------------------------------------------------------------------------------ 
  Line   tests/Architecture/PHPat/SrcShouldNotDependOnTestsTest.php                                                        
 ------ ------------------------------------------------------------------------------------------------------------------ 
  44     Unused Infection\Tests\Architecture\PHPat\SrcShouldNotDependOnTestsTest::testSrcDoesNotDependOnTestsOrBenchmarks  
         🪪  shipmonk.deadMethod                                                                                           
         at tests/Architecture/PHPat/SrcShouldNotDependOnTestsTest.php:44                                                  
 ------ ------------------------------------------------------------------------------------------------------------------ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions