Jeroen-G / autowire

🔌 Autowire and configure using PHP 8 Attributes in Laravel.
MIT License
21 stars 3 forks source link

fix: Crawler should only return interfaces and non-abstract classes #12

Closed bitwise-operators closed 1 year ago

bitwise-operators commented 1 year ago

Right now, the Crawler will return any class-like file, including traits and abstract classes.

This means (for instance) if an abstract class implements an interface, and is the first file found by the Electrician, the plugin will try to inject the abstract class into the Service Provider.

As traits and abstract classes are basically never valid targets for autowiring or configuring, they should probably be filtered out.

Jeroen-G commented 1 year ago

Thank you for your contribution! I only had one remark and then it's ready to go!

bitwise-operators commented 1 year ago

Awesome! Could you tag this merge as a release so it shows up in composer?

Jeroen-G commented 1 year ago

Whoops, sure!