DslInteger.class.php (412B)
1 <?php 2 3 namespace dsl\ast; 4 5 class DslInteger implements DslStatement 6 { 7 private $number; 8 9 /** 10 * DslInteger constructor. 11 * @param $number 12 */ 13 public function __construct($number) 14 { 15 $this->number = $number; 16 } 17 18 19 public function execute( & $context ) { 20 21 return intval($this->number); 22 } 23 24 public function parse($tokens) 25 { 26 $firstToken = $tokens[0]; 27 $this->number = intval( $firstToken->value ); 28 } 29 }