- variable of block can't be overwritten

This commit is contained in:
Dave Mc Nicoll 2025-11-11 18:23:45 +00:00
parent 0c0ba39072
commit c975de0557

View File

@ -229,10 +229,9 @@ class BlockToken implements ControlStructure {
$this->rendering = true;
if ($this->using['this'] ?? false) {
$thisProxy = $this->using['this'];
unset($this->using['this']);
throw new \InvalidArgumentException("Block '{$this->viewPath}' cannot overwrite 'this' variable.");
}
return $classTemplate->picea->inlineBlock($thisProxy ?? $this, $this->viewPath, ...$this->arguments);
}