public function extractParameters(string $path): array
    {
        if ($this->routeParameters === []) {
            return [];
        }
        $parameters = [];
        $pathArray = explode('/', $path);
        array_shift($pathArray);
        foreach ($this->routeParameters as $index => $parameter) {
            $parameterAction = $this->routeParametersOptions[$parameter] ??
                function (string $parameter): string {
                    return $parameter;
                };
            $parameters[$parameter] = $parameterAction($pathArray[$index]);
        }
        return $parameters;
    }
public function extractParameters(string $path): array
    {
        if ($this->routeParameters === []) {
            return [];
        }
        $parameters = [];
        $pathArray = explode('/', $path);
        array_shift($pathArray);
        foreach ($this->routeParameters as $index => $parameter) {
            $parameterAction = $this->routeParametersOptions[$parameter] ??
                function (string $parameter): string {
                    return $parameter;
                };
            $parameters[$parameter] = $parameterAction($pathArray[$index]);
        }
        return $parameters;
    }
public function extractParameters ( string $ path ) : array { if ( $ this -> routeParameters === [ ] ) { return [ ] ; } $ parameters = [ ] ; $ pathArray = explode ( '/' , $ path ) ; array_shift ( $ pathArray ) ; foreach ( $ this -> routeParameters as $ index => $ parameter ) { $ parameterAction = $ this -> routeParametersOptions [ $ parameter ] ?? function ( string $ parameter ) : string { return $ parameter ; } ; $ parameters [ $ parameter ] = $ parameterAction ( $ pathArray [ $ index ] ) ; } return $ parameters ; }
Extract parameters value from path

@param string $path Uri path that match to route without query

@return mixed[] Map parameter_name => value
@throws \Throwable If any route parameter option throw exception
Extract parameters value from path