thephpleague / tactician-phpstan

Static analysis for a small, flexible command bus.
MIT License
10 stars 1 forks source link

Multiple buses #5

Open simPod opened 5 years ago

simPod commented 5 years ago

Related to #1

It's great idea to allow to configure custom bus, was my case as well 👍

However, I have 2 buses. I can't configure both, can I? 🤔

rosstuck commented 5 years ago

I thought a lot about supporting this directly but figured most people had a common supertype on the command buses, because hinting on that interface or parent should work. So that would be the first thing I'd try.

That said, alternate idea: if you copy the contents of extension.neon into your phpstan.neon and register the same classes there once per Command bus.

Can you confirm that either of those work? I'd still consider creating an easier config method but want to see what the demand is and what works as is.

simPod commented 5 years ago

Yup, created a new interface Bus that all other buses extend. Works fine I'd say. Thanks.

rosstuck commented 5 years ago

Okay, I'll add it to the docs then