You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The detection of usage of variables created via {var} seems to be broken when usage occurs inside {foreach} while the whole template is enclosed in {block}..{/block}.
Environment (please complete the following information):
PhpStorm version 2023.3.5
Plugin version 2.0.0@beta1
PHPStorm cache invalidated and cleaned
To Reproduce
Paste code below to a new file.
See that $level in {var $level = 0} is hinted as unused variable, which is not true, as it is used inside of {foreach}. Also $level in {php $level++} is marked as Undefined variable.
Code
{block content}{var $level = 0}{foreach$groups as $value}{php $level++}{/foreach}{/block}
Screenshots
Additional context
If I remove {block content} and {/block} from the code, the variable is no longer marked as unused.
The text was updated successfully, but these errors were encountered:
An element of an array is indicated as "Print invalid type: array" in Inspection, as if I were trying to print the entire array.
A variable that is declared as default null is indicated as "Print invalid type: null", even though the printout occurs in n:ifset="" condition that rules out the value of null.
Also, the inspection for print invalid type is named "Tag var content". There are two such entries in Inspections / Latte / Not allowed, one of them actually checks tag var content, the other checks invalid printing types.
This is obviously a minor misprint, copied value from an older inspection, still a bit confusing if you want to turn the broken printing detections off.
Describe the bug
The detection of usage of variables created via
{var}
seems to be broken when usage occurs inside{foreach}
while the whole template is enclosed in{block}..{/block}
.Environment (please complete the following information):
To Reproduce
$level
in{var $level = 0}
is hinted as unused variable, which is not true, as it is used inside of{foreach}
. Also$level
in{php $level++}
is marked as Undefined variable.Code
Screenshots
Additional context
If I remove
{block content}
and{/block}
from the code, the variable is no longer marked as unused.The text was updated successfully, but these errors were encountered: