Some quirky results in PhpStorm 3.0

I just started using version 3.0, and I'm getting some odd warnings.

For example on the second line of this code...

            $wicon = ($colc <= 4) ? "img/icon_wait.gif" : "img/icon_waitsm.gif";
            $wl = "<img src=\"$wicon\" alt=\"waitlist\" class=\"statusicon\">";

It gives a warning...
     Cannot resolve file \"$wicon\

Surely the parser should be able to recognise that that part of the code is dynamic, and not attempt to resolve it to an actual filename.


Also in the same file, though it appears unrelated, it had an error message at the end saying "Expected: }"

I've checked the file multiple times, and all the braces lined up, and the code ran fine.

In the end I tried just cutting the body of the class and repasting it, and the error went away.  It seems the parser had got confused somehow, and a cut/paste gave it a chance to rethink things.

2 comments
Comment actions Permalink

"Also in the same file, though it appears unrelated, it had an error message at the end saying "Expected: }""

I am seeing this all over the place. Other IDE's (like Zend Studio and Dreamweaver) do not report errors on the file. And not to mention, the file runs fine.

By the way, the cut-n-paste works for me too. If I copy all the code (CMD + A) then Paste or Undo, this issue is resolved.

To add; this happens in every file I open. And it is NOT happening in 2.1.5

0
Comment actions Permalink

Hi Jonathan,

For example on the second line of this code...

This could be the corresponding ticket: http://youtrack.jetbrains.net/issue/WI-2450?projectKey=WI

Surely the parser should be able to recognise that that part of the code is dynamic, and not attempt to resolve it to an actual filename.

It surelly makes sense, but some other PhpStorm users think otherwise -- PhpStorm still should be able to validate such inclusions (at least in simple cases -- and AFAIK it does for some SQL) -- clearly conflict of interests ...

Solution in your case -- un-inject the HTML language from variable value .. so it will be treated as simple text (and now HTML validations will be applied).

0

Please sign in to leave a comment.