'Unused local variable' for variable in blade foreach loops
In every foreach loop of my blade templates i get an 'unused local variable warning' (check the image) also if i use the variable in the body of the foreach. Any idea on why it happens?
Please sign in to leave a comment.
Hi there,
No clue -- never seen it in Blade files.
umh...strange, i thought it was a known bug, as i'have this problem since 2017.1
Invalidating and restarting doesn't work,
It does the same on every blade file, even if the file is empty and has only the foreach. On the other end if i use the php tags it works correctly:
Can it be the blade plugin ? Maybe i can try to uninstall it, or maybe it could be another plugin ?
ok, found the cause: i had this inspection enabled: php -> ununsed local variable -> enable inspection in global space.
Anyway it's strange that with <?php tags it doesn't give the warning while with @foreach yes...
Please vote https://youtrack.jetbrains.com/issue/WI-27784