File modules/dsl/standard/Writer.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 namespace dsl\standard; 4 5 class Writer 6 { 7 public $buffer; 8 9 /** 10 * Write something to an output queue. 11 * 12 * @param $text 13 */ 14 public function __invoke( $text ) 15 { 16 if ( is_object($text ) && !method_exists($text, '__toString') ) 17 // Workaround for external objects, that do not implement __toString() 18 $this->buffer .= get_class($text); 19 elseif ( is_array($text) ) 20 $this->buffer .= '['.implode(',',$text).']'; 21 else 22 $this->buffer .= $text; 23 } 24 }
Download modules/dsl/standard/Writer.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.