src/Validator/ServiceValidator.php
private function getServiceArgs(array $serviceHandler, array $serviceData): array
    {
        list($className, $method) = $serviceHandler;
        $rc = new \ReflectionClass($className);
        $rm = $rc->getMethod($method);
        $mps = $rm->getParameters();
        $params = $serviceData['params'] ?? [];

        if (empty($params)) {
            return [];
        }

        $index = 0;
        $args = [];
        foreach ($mps as $mp) {
            $name = $mp->getName();
            if (! isset($params[$index])) {
                break;
            }
            $args[$name] = $params[$index];
            $index++;
        }

        return $args;
    }
private function getServiceArgs(array $serviceHandler, array $serviceData): array
    {
        list($className, $method) = $serviceHandler;
        $rc = new \ReflectionClass($className);
        $rm = $rc->getMethod($method);
        $mps = $rm->getParameters();
        $params = $serviceData['params'] ?? [];

        if (empty($params)) {
            return [];
        }

        $index = 0;
        $args = [];
        foreach ($mps as $mp) {
            $name = $mp->getName();
            if (! isset($params[$index])) {
                break;
            }
            $args[$name] = $params[$index];
            $index++;
        }

        return $args;
    }
private function getServiceArgs ( array $ serviceHandler , array $ serviceData ) : array { list ( $ className , $ method ) = $ serviceHandler ; $ rc = new \ ReflectionClass ( $ className ) ; $ rm = $ rc -> getMethod ( $ method ) ; $ mps = $ rm -> getParameters ( ) ; $ params = $ serviceData [ 'params' ] ?? [ ] ; if ( empty ( $ params ) ) { return [ ] ; } $ index = 0 ; $ args = [ ] ; foreach ( $ mps as $ mp ) { $ name = $ mp -> getName ( ) ; if ( ! isset ( $ params [ $ index ] ) ) { break ; } $ args [ $ name ] = $ params [ $ index ] ; $ index ++ ; } return $ args ; }
get args of called function

@param array $serviceHandler
@param array $serviceData
@return array
@throws \ReflectionException
get args of called function