作者:hpdgm_679 | 来源:互联网 | 2023-05-19 18:00
Iwanttouseinterfaces,butsomeofmyimplementationsrelyonmagicmethodssuchas__invokeand
I want to use interfaces, but some of my implementations rely on magic methods such as __invoke and __call. I have to remove signatures of methods that may be invoked magically (in any implementation) from the interface. Which leads to the anti pattern Empty Interface (Yeah, I just made that up).
我想使用接口,但我的一些实现依赖于魔术方法,如__invoke和__call。我必须删除可以从界面神奇地(在任何实现中)调用的方法的签名。这导致反模式空接口(是的,我刚刚做到了)。
How do you combine interfaces and magic methods in PHP?
如何在PHP中结合接口和魔术方法?
1 个解决方案