src/Analysis/Inspector.php
public static function parameters($class, $method, $data = null)
    {
        $params = [];
        $reflexion = Inspector::inspect($class);
        $parameters = $reflexion->getMethod($method)->getParameters();
        if ($data === null) {
            return $parameters;
        }
        foreach ($data as $key => $value) {
            $name = $key;
            if ($parameters) {
                $parameter = array_shift($parameters);
                $name = $parameter->getName();
            }
            $params[$name] = $value;
        }
        foreach ($parameters as $parameter) {
            if ($parameter->isDefaultValueAvailable()) {
                $params[$parameter->getName()] = $parameter->getDefaultValue();
            }
        }
        return $params;
    }
public static function parameters($class, $method, $data = null)
    {
        $params = [];
        $reflexion = Inspector::inspect($class);
        $parameters = $reflexion->getMethod($method)->getParameters();
        if ($data === null) {
            return $parameters;
        }
        foreach ($data as $key => $value) {
            $name = $key;
            if ($parameters) {
                $parameter = array_shift($parameters);
                $name = $parameter->getName();
            }
            $params[$name] = $value;
        }
        foreach ($parameters as $parameter) {
            if ($parameter->isDefaultValueAvailable()) {
                $params[$parameter->getName()] = $parameter->getDefaultValue();
            }
        }
        return $params;
    }
public static function parameters ( $ class , $ method , $ data = null ) { $ params = [ ] ; $ reflexion = Inspector :: inspect ( $ class ) ; $ parameters = $ reflexion -> getMethod ( $ method ) -> getParameters ( ) ; if ( $ data === null ) { return $ parameters ; } foreach ( $ data as $ key => $ value ) { $ name = $ key ; if ( $ parameters ) { $ parameter = array_shift ( $ parameters ) ; $ name = $ parameter -> getName ( ) ; } $ params [ $ name ] = $ value ; } foreach ( $ parameters as $ parameter ) { if ( $ parameter -> isDefaultValueAvailable ( ) ) { $ params [ $ parameter -> getName ( ) ] = $ parameter -> getDefaultValue ( ) ; } } return $ params ; }
Gets the parameters array of a class method.

@param  $class  The class name.
@param  $method The method name.
@param  $data   The default values.
@return array   The parameters array.
Gets the parameters array of a class method .