_value.''; } /** * finish (does nothing =)) */ public function finish() { } /** * @see take() */ public function take($value) { $int = new IntermediateObject($value); return new AndObject($int); } /** * Displays current value with echo * @return IntermediateObject $this */ public function display() { echo $this->_value; return new AndObject(new IntermediateObject($this->_value)); } /** * Assigns value to variable. Can use it(). Sets active value to $value * @see assign() * @param mixed $value * @return AssignIntermediate */ public function assign($value) { if($value instanceof ItObject) $value = $this->_value; $int = new AssignIntermediate($value); return $int; } /** * Calls a function or method. * With it() calls the active value as a function, * with its()->method, tries to call a method of the active value * otherwise will try calling $what * @param ItObject|ItsObject|string $what * @return CallIntermediate */ public function call($what) { $int = null; if($what instanceof ItObject) { $int = new CallIntermediate($this->_value); } else if($what instanceof ItsObject) { $int = new CallIntermediate(array($this->_value, $what->getMethod())); } else $int = new CallIntermediate($what); return $int; } public function __call($method, $args) { if($method == 'if') { return new IfIntermediate($args[0]); } if($method == 'while') return new WhileIntermediate($args[0]); } public function from($start) { return new FromIntermediate($start); } }