I know PHP CS Fixer and Psalm to lint PHP. I've been using both of them. But I can't find a way to lint / validate my namespace name based on the folder.
For example, in folder Tests/Controllers/V1
, I have MyControllerTest.php
, and it has the following codes:
<?php
// I should have correct namespace based on folder name not V2 but V1
namespace Tests\Controllers\V2;
.. ... my code
How can I lint the above code with correct namespace?
NOTE: I am using PHP 7.3.