public function compilePreconditions(ExpressionCompiler $compiler, ExpressionInterface $parameter) { $compiler->verifyItem('object', 'CG\\Proxy\\MethodInvocation'); if (!isset($compiler->attributes['parameter_mapping_name'])) { $this->addParameterMapping($compiler); } $compiler->writeln("if (!isset(\${$compiler->attributes['parameter_mapping_name']}['{$parameter->name}'])) {")->indent()->write("throw new RuntimeException(sprintf('There is no parameter with name \"{$parameter->name}\" for method \"%s\".', ")->compileInternal(new VariableExpression('object'))->writeln("));")->outdent()->write("}\n\n"); }
public function compilePreconditions(ExpressionCompiler $compiler, ExpressionInterface $expr) { if (!$expr->allowNull && !$this->isKnown($expr->name)) { $compiler->verifyItem($expr->name); } }