Swat/SwatError.php
protected function getArguments($args, $function = null, $class = null)
    {
        $params = array();
        $method = null;

        // try to get function or method parameter list using reflection
        if ($class !== null && $function !== null && class_exists($class)) {
            $class_reflector = new ReflectionClass($class);
            if ($class_reflector->hasMethod($function)) {
                $method = $class_reflector->getMethod($function);
                $params = $method->getParameters();
            }
        } elseif ($function !== null && function_exists($function)) {
            $method = new ReflectionFunction($function);
            $params = $method->getParameters();
        }

        // display each parameter
        $formatted_values = array();
        for ($i = 0; $i < count($args); $i++) {
            $value = $args[$i];

            if ($method !== null && array_key_exists($i, $params)) {
                $name = $params[$i]->getName();
                $sensitive = $this->isSensitiveParameter($method, $name);
            } else {
                $name = null;
                $sensitive = false;
            }

            if ($name !== null && $sensitive) {
                $formatted_values[] = $this->formatSensitiveParam(
                    $name,
                    $value
                );
            } else {
                $formatted_values[] = $this->formatValue($value);
            }
        }

        return implode(', ', $formatted_values);
    }
protected function getArguments($args, $function = null, $class = null)
    {
        $params = array();
        $method = null;

        // try to get function or method parameter list using reflection
        if ($class !== null && $function !== null && class_exists($class)) {
            $class_reflector = new ReflectionClass($class);
            if ($class_reflector->hasMethod($function)) {
                $method = $class_reflector->getMethod($function);
                $params = $method->getParameters();
            }
        } elseif ($function !== null && function_exists($function)) {
            $method = new ReflectionFunction($function);
            $params = $method->getParameters();
        }

        // display each parameter
        $formatted_values = array();
        for ($i = 0; $i < count($args); $i++) {
            $value = $args[$i];

            if ($method !== null && array_key_exists($i, $params)) {
                $name = $params[$i]->getName();
                $sensitive = $this->isSensitiveParameter($method, $name);
            } else {
                $name = null;
                $sensitive = false;
            }

            if ($name !== null && $sensitive) {
                $formatted_values[] = $this->formatSensitiveParam(
                    $name,
                    $value
                );
            } else {
                $formatted_values[] = $this->formatValue($value);
            }
        }

        return implode(', ', $formatted_values);
    }
protected function getArguments ( $ args , $ function = null , $ class = null ) { $ params = array ( ) ; $ method = null ; // try to get function or method parameter list using reflection if ( $ class !== null && $ function !== null && class_exists ( $ class ) ) { $ class_reflector = new ReflectionClass ( $ class ) ; if ( $ class_reflector -> hasMethod ( $ function ) ) { $ method = $ class_reflector -> getMethod ( $ function ) ; $ params = $ method -> getParameters ( ) ; } } elseif ( $ function !== null && function_exists ( $ function ) ) { $ method = new ReflectionFunction ( $ function ) ; $ params = $ method -> getParameters ( ) ; } // display each parameter $ formatted_values = array ( ) ; for ( $ i = 0 ; $ i < count ( $ args ) ; $ i ++ ) { $ value = $ args [ $ i ] ; if ( $ method !== null && array_key_exists ( $ i , $ params ) ) { $ name = $ params [ $ i ] -> getName ( ) ; $ sensitive = $ this -> isSensitiveParameter ( $ method , $ name ) ; } else { $ name = null ; $ sensitive = false ; } if ( $ name !== null && $ sensitive ) { $ formatted_values [ ] = $ this -> formatSensitiveParam ( $ name , $ value ) ; } else { $ formatted_values [ ] = $ this -> formatValue ( $ value ) ; } } return implode ( ', ' , $ formatted_values ) ; }
Formats a method call's arguments

This method is also responsible for filtering sensitive parameters
out of the final stack trace.

@param array $args an array of arguments.
@param string $method optional. The current method or function.
@param string $class optional. The current class name.

@return string the arguments formatted into a comma delimited string.
Formats a method call s arguments