driftingly / rector-laravel

Rector upgrades rules for Laravel
http://getrector.org
MIT License
469 stars 48 forks source link

Declare type configs #184

Open peterfox opened 5 months ago

peterfox commented 5 months ago

Still a work in progress but would love some early feedback.

Changes

Why

One of the powerful things about Rector is being able to add type declarations. Laravel uses a lot of closures that users of the framework often won't type hint due to not knowing the correct types to apply. These configs make use of the rules I created in the base rector repo. This will allow for configs that define what types to apply to closures.

So far documented common eloquent type hints and service container ones.

Notes

Currently pointed at rector dev-main until a new release with the closure type hinting exists.

driftingly commented 5 months ago

Thanks @peterfox 🙌 I like where this is going.