[FIXED] PhpStorm Parameter Scalar Type Hint mixed with namespace

Answered

I'm having trouble with PhpStorm type hint, the `Symfony\Component\HttpFoudantion\Response::setStatusCode` for example accepts `int` but when i pass an `int`, PhpStorm says the method expected `Symfony\Component\HttpFoudantion\int`, `int` was given, how do i deal with this ?

Here's an other example :

 

4 comments

Hi there,

How GetResponseForControllerResultEvent is declared? Must be some wrong declaration there (looks like it).

0

Yes, that signature is OK.

Another thought -- what PHP Language Level do you have set in PhpStorm for this project? Maybe it's lower than 7.0 (when such native typehints were introduced)?

No better ideas right now, except trying "File | Invalidate Caches..." and restarting IDE if you have not done it yet.

2

PHP Language level is 7.2 ( php Interpreter 7.2.6 )
invalidating the cache and restarting fixed the issues, thanks for your support.

0

Please sign in to leave a comment.