diff --git a/src/ControlStructure/BlockToken.php b/src/ControlStructure/BlockToken.php index cfa04e6..cd718c1 100644 --- a/src/ControlStructure/BlockToken.php +++ b/src/ControlStructure/BlockToken.php @@ -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); }