getDiagnosticReporter()->fatal($msg); } public function fatalError(NodeAbstract $node, string $msg): never { $this->error("{$msg} in {$this->file}:{$node->getStartLine()}"); } protected function warning(Node $node, string $msg): void { $this->getDiagnosticReporter()->warning($node, $this->file, $msg); } protected function fatalCompileTimeAttribute( Node $target, string $attribute, string $message, ?Node $source = null, ?string $conflictAttribute = null, ?Node $conflictSource = null, ): never { $this->error(CompileTimeAttributeDiagnostic::format( $message, $attribute, $target, $this->file, $source, $conflictAttribute, $conflictSource, )); } protected function errorUndefinedVariable(Variable $node): never { $this->fatalError($node, "The variable `\${$node->name}` is undefined"); } protected function warningUndefinedBehavior(NodeAbstract $expr): void { $this->warning($expr, 'Use this expression carefully, which may be inconsistent with the dynamic execution behavior'); } protected function dump(NodeAbstract $node): void { if ($this->debugLine == $node->getStartLine()) { var_dump($node); } } protected function foundStrayCode(Node $node): never { $this->fatalError($node, 'All execution code must be within a function, found stray code'); } }