private function getAllowedMethods(ServerRequestInterface $request): array
    {
        $allowed = [];

        $requestPath = $request->getUri()->getPath();

        foreach (Method::all() as $method) {
            $matchThis = "$requestPath{}$method";

            if (preg_match($this->pattern, $matchThis, $matches) === 1) {
                $allowed[$method] = $this->getRoute($matches);
            }
        }

        return $allowed;
    }
private function getAllowedMethods(ServerRequestInterface $request): array
    {
        $allowed = [];

        $requestPath = $request->getUri()->getPath();

        foreach (Method::all() as $method) {
            $matchThis = "$requestPath{}$method";

            if (preg_match($this->pattern, $matchThis, $matches) === 1) {
                $allowed[$method] = $this->getRoute($matches);
            }
        }

        return $allowed;
    }
private function getAllowedMethods ( ServerRequestInterface $ request ) : array { $ allowed = [ ] ; $ requestPath = $ request -> getUri ( ) -> getPath ( ) ; foreach ( Method :: all ( ) as $ method ) { $ matchThis = "$requestPath{}$method" ; if ( preg_match ( $ this -> pattern , $ matchThis , $ matches ) === 1 ) { $ allowed [ $ method ] = $ this -> getRoute ( $ matches ) ; } } return $ allowed ; }
Get an array of allowed methods and their routes.

@param ServerRequestInterface $request
@return array
Get an array of allowed methods and their routes .