setHeader not available in Responseinterface |
intelephense is broken or strict.
I recommend PhpStorm if you want better development experience.
Ok, i think i have to learn the concept of interfaces. I looked in the interface and the setHeader method is not available there. I thought i could only use the methods from the interface if the param is type hinted with the interface. But i can also use a method from the class which implements this interface.
Yes, learning the concept of interfaces is good.
What you need to know here are: 1. an interface cannot be instantiated. a class (not abstract class) can be instantiated. 2. if a interface is type hinted, you should use methods in the interface. so you are not wrong. The CI4's the type hint is broken now.
Sorry, it will take long time to fix, because it is difficult to fix it.
We need to rewrite Request/Response class and its interface to PSR compatible, and it brings a lot of breaking changes. So it takes time, and we need to wait for the next major version (v5). We need more contributors! |
Welcome Guest, Not a member yet? Register Sign In |