You are here

private function SassScriptFunction::process_arguments in Sassy 7.3

1 call to SassScriptFunction::process_arguments()
SassScriptFunction::perform in phpsass/script/SassScriptFunction.php
Evaluates the function. Look for a user defined function first - this allows users to override pre-defined functions, then try the pre-defined functions.

File

phpsass/script/SassScriptFunction.php, line 46

Class

SassScriptFunction
SassScriptFunction class. Preforms a SassScript function. @package PHamlP @subpackage Sass.script

Code

private function process_arguments($input) {
  if (is_array($input)) {
    $output = array();
    foreach ($input as $token) {
      $output[] = trim($this
        ->process_arguments($token), '\'"');
    }
    return $output;
  }
  $token = $input;
  if (is_null($token)) {
    return ' ';
  }
  if (!is_object($token)) {
    return (string) $token;
  }
  if (method_exists($token, 'toString')) {
    return $token
      ->toString();
  }
  if (method_exists($token, '__toString')) {
    return $token
      ->__toString();
  }
  if (method_exists($token, 'perform')) {
    return $token
      ->perform();
  }
  return '';
}