src/eMacros/Runtime/Collection/ArraySort.php
public function apply(Scope $scope, GenericList $arguments) {
		if (count($arguments) == 0) throw new \BadFunctionCallException("ArraySort: No array specified.");
		$target = $arguments[0];
		if (!($target instanceof Symbol))
			throw new \InvalidArgumentException(sprintf("ArraySort: Expected symbol as first argument but %s was found instead.", substr(strtolower(strstr(get_class($arguments[0]), '\\')), 1)));
		$ref = $target->symbol;
		
		if (is_array($scope->symbols[$ref])) {
			$func = $this->callback;
			if (count($arguments) > 1)
				return $func($scope->symbols[$ref], $arguments[1]->evaluate($scope));
			return $func($scope->symbols[$ref]);
		}
		
		throw new \InvalidArgumentException(sprintf("ArraySort: Expected array as first argument but %s was found instead.", gettype($scope->symbols[$ref])));
	}
public function apply(Scope $scope, GenericList $arguments) {
		if (count($arguments) == 0) throw new \BadFunctionCallException("ArraySort: No array specified.");
		$target = $arguments[0];
		if (!($target instanceof Symbol))
			throw new \InvalidArgumentException(sprintf("ArraySort: Expected symbol as first argument but %s was found instead.", substr(strtolower(strstr(get_class($arguments[0]), '\\')), 1)));
		$ref = $target->symbol;
		
		if (is_array($scope->symbols[$ref])) {
			$func = $this->callback;
			if (count($arguments) > 1)
				return $func($scope->symbols[$ref], $arguments[1]->evaluate($scope));
			return $func($scope->symbols[$ref]);
		}
		
		throw new \InvalidArgumentException(sprintf("ArraySort: Expected array as first argument but %s was found instead.", gettype($scope->symbols[$ref])));
	}
Array sort wrapper callback
Usage: (Array::sort _array) (Array::arsort _arr)
Returns: boolean
(non-PHPdoc)
@see \eMacros\Applicable::apply()