Closed GeniJaho closed 4 months ago
Have you tested this? It might not work as Dispatchables is a trait if I remember correctly and won't be picked up in the same way PHPStan does with Classes and Interfaces because it's not a type.
@peterfox Yes, both in a real project and with tests in the rector-laravel code. The RenameMethodRector
takes trait uses into account when we provide traits instead of regular classes to it.
It would be great if we could add tests for the sets instead of just the rules. Not sure if this has been mentioned or considered before in the core Rector repo.
@GeniJaho okay good to know, I know when I've used PHPStan directly I found it didn't find traits so wanted to double check.
I created a folder for testing Sets if you're asking if it's possible? It's just creating a config that points to the sets. Tests are otherwise the same as rule tests.
@peterfox that's exactly what I was looking for, thank you. I didn't know we already had them.
I added tests for the Laravel 10 Set and fixed a 'bad' configuration for renaming $routeMiddleware
in the Http Kernel.
Fixes https://github.com/driftingly/rector-laravel/issues/215.