File modules/dsl/context/BaseScriptableObject.class.php

Last commit: Fri Jul 1 18:09:05 2022 +0200	Jan Dankert	New: Bugfixes and much more string and array functions for the DSL.
1 <?php 2 3 4 namespace dsl\context; 5 6 use dsl\standard\Helper; 7 8 class BaseScriptableObject implements Scriptable 9 { 10 /** 11 * Standard String representation of a Scriptable Object. 12 * This object becomes "Stringable". 13 * This string may be used in userscripts, if the object is used as a string, maybe by mistake. 14 * 15 * This method may be overwritten by subclasses. 16 * 17 * @return string 18 */ 19 public function __toString() 20 { 21 return "Script object"; 22 } 23 24 25 /** 26 * a useful help function which outputs all properties and methods of this objects. 27 * 28 * @return string a short info about this object 29 */ 30 public function help() 31 { 32 return Helper::getHelp($this); 33 } 34 35 36 public function getClass() { 37 return get_class($this); 38 } 39 40 public function values() { 41 return array_values(get_object_vars($this)); 42 } 43 public function keys() { 44 return array_keys(get_object_vars($this)); 45 } 46 }
Download modules/dsl/context/BaseScriptableObject.class.php
History Fri, 1 Jul 2022 18:09:05 +0200 Jan Dankert New: Bugfixes and much more string and array functions for the DSL. Mon, 27 Jun 2022 01:11:02 +0200 Jan Dankert New: Secure Flag for Script Interpreter which is enabled by default. Mon, 27 Jun 2022 00:40:42 +0200 Jan Dankert New: Marker interface 'Scriptable', Proxy class for MQTT, help() method in Scripts.