示例#1
0
 public function visitIntegerNode(IntegerNode $node)
 {
     $val = $node->getValue();
     return "{$val}:int";
 }
示例#2
0
 public function visitIntegerNode(IntegerNode $node)
 {
     return $node->getValue();
 }
 public function visitIntegerNode(IntegerNode $node)
 {
     return new RationalNode($node->getValue(), 1);
 }
示例#4
0
 public function visitIntegerNode(IntegerNode $node)
 {
     return Complex::create($node->getValue(), 0);
 }
示例#5
0
 public function testCanCreateIntegerNode()
 {
     $node = new IntegerNode(1);
     $this->assertEquals($node->getValue(), 1);
     $node = new IntegerNode(-1);
     $this->assertEquals($node->getValue(), -1);
     $this->setExpectedException(\UnexpectedValueException::class);
     $node = new IntegerNode(1.2);
 }