/**
* Call a method of the scope and output it
*
* @param *string $name the name of the method
* @param *array $args arguments that were passed
*
* @return mixed
*/
public function __call($name, $args)
{
Argument::i()->test(1, 'string')->test(2, 'array');
//if the scope is null
if (is_null($this->scope)) {
//just call the parent
return parent::__call($name, $args);
}
//get the results from the method call
$results = $this->getResults($name, $args);
//set temp variables
$name = $this->name;
$scope = $this->scope;
//reset globals
$this->name = null;
$this->scope = null;
//if there's a property name
if ($name) {
//output that
$scope->inspect($name);
//and return the results
return $results;
}
//at this point we should output the results
$class = get_class($scope);
$output = sprintf(self::INSPECT, $class . '->' . $name);
$this->output($output)->output($results);
//and return the results
return $results;
}