You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes. You'd subclass framework classes and override some methods so it has to obey the covariance and contravariance rules. Of course it's not just Void, for example you'd also override buildRules():
public function buildRules(RulesChecker $rules): RulesChecker
If I have this extern for a CakePHP class
And this subclass
Then this php is emitted
But initialize() has a return type declaration from CakePHP 4 onward so this doesn't work too well:
It would be nice if extern methods could be annotated as having a return type so the compiler would emit overrides with the correct type.
The text was updated successfully, but these errors were encountered: