src/Dispatcher/ClosureAutoBind.php
private function getFunctionArguments(array $paramMap, array $matches, array $parameters) : array
    {
        $output  = [];
        $matches = array_values($matches);

        foreach ($parameters as $valueName) {
            foreach ($paramMap as $possition => $value) {
                if ($value == $valueName[1][0]) {
                    $output[] = $matches[$possition];
                }
            }
        }

        return $output;
    }
private function getFunctionArguments(array $paramMap, array $matches, array $parameters) : array
    {
        $output  = [];
        $matches = array_values($matches);

        foreach ($parameters as $valueName) {
            foreach ($paramMap as $possition => $value) {
                if ($value == $valueName[1][0]) {
                    $output[] = $matches[$possition];
                }
            }
        }

        return $output;
    }
private function getFunctionArguments ( array $ paramMap , array $ matches , array $ parameters ) : array { $ output = [ ] ; $ matches = array_values ( $ matches ) ; foreach ( $ parameters as $ valueName ) { foreach ( $ paramMap as $ possition => $ value ) { if ( $ value == $ valueName [ 1 ] [ 0 ] ) { $ output [ ] = $ matches [ $ possition ] ; } } } return $ output ; }
Get arguments for closure function in proper order
from provided parameters

@param array $paramMap   parameter map for getting proper order
@param array $matches    parameters from request
@param array $parameters expected parameters from route

@return array Parameters in right order, if there are not any
parametrs an empty array is returned.
Get arguments for closure function in proper order from provided parameters