コード例 #1
0
ファイル: Walker.php プロジェクト: pscheit/psc-cms
 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'));
 }
コード例 #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());
 }