Woozle Hypertwin on Nostr: An observation: #phpactor is nifty but also often inaccurate. (in this case: claiming ...
An observation: #phpactor is nifty but also often inaccurate.
(in this case: claiming an imported interface is never used, when in fact it is used in an is_subclass_of() check about a dozen lines later. It's also grousing about a called method in a trait not being declared in that same trait... but that's the thing about traits: there's no syntax to say "this trait should only be used by class X" or "this trait implements interface Y"... and if you declare the method as abstract, PHP might scream "collision!" when you use the trait. ...or is that only for non-abstract methods? Anyway, it gets ambiguous for me, so I avoid doing that.)
(in this case: claiming an imported interface is never used, when in fact it is used in an is_subclass_of() check about a dozen lines later. It's also grousing about a called method in a trait not being declared in that same trait... but that's the thing about traits: there's no syntax to say "this trait should only be used by class X" or "this trait implements interface Y"... and if you declare the method as abstract, PHP might scream "collision!" when you use the trait. ...or is that only for non-abstract methods? Anyway, it gets ambiguous for me, so I avoid doing that.)