original_string: public static function reflectionFunction($function, $arguments = []) {
          $method = is_array($function);
  
          if($method) {
              $reflection = new ReflectionMethod($function[0], $function[1]);
          }
          else {
              $reflection = new ReflectionFunction($function);
          }
  
          $args = self::getReflectionArgs($reflection, $arguments, $missing);
  
          if($missing) {
              $name = $reflection->getName();
              $parts = [];
              foreach($missing as $key => $name) {
                  $parts[] = "'$name' (or '$key')";
              }
              $missing = implode(", ", $parts);
              throw new Exception("Can not call function '$name'. Argument(s) $missing need to be set.");
          }
  
          return $method ? $reflection->invokeArgs($function[0], $args) : $reflection->invokeArgs($args);
      }
code: public static function reflectionFunction($function, $arguments = []) {
          $method = is_array($function);
  
          if($method) {
              $reflection = new ReflectionMethod($function[0], $function[1]);
          }
          else {
              $reflection = new ReflectionFunction($function);
          }
  
          $args = self::getReflectionArgs($reflection, $arguments, $missing);
  
          if($missing) {
              $name = $reflection->getName();
              $parts = [];
              foreach($missing as $key => $name) {
                  $parts[] = "'$name' (or '$key')";
              }
              $missing = implode(", ", $parts);
              throw new Exception("Can not call function '$name'. Argument(s) $missing need to be set.");
          }
  
          return $method ? $reflection->invokeArgs($function[0], $args) : $reflection->invokeArgs($args);
      }
code_tokens: public static function reflectionFunction ( $ function , $ arguments = [ ] ) { $ method = is_array ( $ function ) ; if ( $ method ) { $ reflection = new ReflectionMethod ( $ function [ 0 ] , $ function [ 1 ] ) ; } else { $ reflection = new ReflectionFunction ( $ function ) ; } $ args = self :: getReflectionArgs ( $ reflection , $ arguments , $ missing ) ; if ( $ missing ) { $ name = $ reflection -> getName ( ) ; $ parts = [ ] ; foreach ( $ missing as $ key => $ name ) { $ parts [ ] = "'$name' (or '$key')" ; } $ missing = implode ( ", " , $ parts ) ; throw new Exception ( "Can not call function '$name'. Argument(s) $missing need to be set." ) ; } return $ method ? $ reflection -> invokeArgs ( $ function [ 0 ] , $ args ) : $ reflection -> invokeArgs ( $ args ) ; }
docstring: Invokes functions by assembling arguments from an array with the help of the reflection API.
  
  @todo Better doc here - refer to getReflectionArgs
docstring_tokens: Invokes functions by assembling arguments from an array with the help of the reflection API .