public function walkVariableDefinition(LVariableDefinition $variableDefinition) { return $this->codeWriter->writeVariableDefinition($this->walkVariable($variable = $variableDefinition->getVariable()), $variableDefinition->hasValue() ? $this->walkValue($variableDefinition->getInitializer(), $variable->getType()->unwrap()) : $this->walkExpression($variableDefinition->getInitializer(), 'variableDefinition')); }
protected function assertEqualsVariableDefinition(AST\LVariableDefinition $expected, AST\LVariableDefinition $actual) { $this->assertEquals($expected->getVariable()->getName(), $actual->getVariable()->getName()); $this->assertEquals($expected->getVariable()->getType()->unwrap(), $actual->getVariable()->getType()->unwrap(), 'type von ' . $actual->getVariable()->getName()); $this->assertEquals($expected->getInitializer()->unwrap(), $actual->getInitializer()->unwrap(), 'initializer von ' . $actual->getVariable()->getName()); }