File modules/dsl/standard/BooleanInstance.class.php

Last commit: Tue Jul 19 00:10:00 2022 +0200	Jan Dankert	New: Scripting language: Ignore Keyword "new"; Support for Calling object constructors; Splitting objects into an instance and a wrapper.
1 <?php 2 3 4 namespace dsl\standard; 5 6 7 use dsl\context\BaseScriptableObject; 8 9 class BooleanInstance extends BaseScriptableObject 10 { 11 private $value; 12 13 /** 14 * Number constructor. 15 * @param $value 16 */ 17 public function __construct($value) 18 { 19 $this->value = boolval($value); 20 } 21 22 public function __toString() 23 { 24 return $this->value?'true':'false'; 25 } 26 27 28 public function __invoke( $value ) 29 { 30 return new BooleanInstance( $value ); 31 } 32 public function length() 33 { 34 return 1; 35 } 36 37 }
Download modules/dsl/standard/BooleanInstance.class.php
History Tue, 19 Jul 2022 00:10:00 +0200 Jan Dankert New: Scripting language: Ignore Keyword "new"; Support for Calling object constructors; Splitting objects into an instance and a wrapper.