Welcome Guest, Not a member yet? Register   Sign In
setHeader not available in Responseinterface
#11

intelephense is broken or strict.
I recommend PhpStorm if you want better development experience.
Reply
#12

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.
Reply
#13

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.
Reply
#14

(06-30-2022, 04:52 PM)kenjis Wrote: The CI4's the type hint is broken now.

Thank you. I hope it will be fixed soon :-)
Reply
#15

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!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB