Ejemplo n.º 1
0
 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'));
 }
Ejemplo n.º 2
0
 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());
 }