r/PHP•
BigBootyBear

How are you catching PHP dependency errors in CI?

I've recently had to fix a bug i've introduced in a submitted PR because my attempt to flatten a files dependencies. Basically, A requires B, and B requires C (which A needs). I've made A explicitly import B and C and it introduced a silent bug cause B requires a dep in a 100 line barrel file.

I've got a few ideas on how to write unit tests to catch these bugs in CI but they're all ugly and manual. I know of tools like rector that simplify refactoring but of no solutions to sanity test an external files dependencies.

Posted Jul 23, 2026, 5:10 AM UTC

012
Loading comments…