src/Provider/FileProvider.php
/**
     * Canonizes the list of methods to a standard format.
     * @param string|string[] $methods Single method or an array of methods
     * @return string[] List of accepted methods
     */
Canonizes the list of methods to a standard format.
@param string|string[] $methods Single method or an array of methods
@return string[] List of accepted methods
Canonizes the list of methods to a standard format . @param string|string [] $methods Single method or an array of methods @return string [] List of accepted methods
private function canonizeMethods($methods)
    {
        $methods = array_map('strtoupper', is_array($methods) ? $methods : [$methods]);
        if (in_array(current($methods), ['', '*', 'ANY'])) {
            return self::$httpMethods;
        }
        $methods = array_intersect($methods, self::$httpMethods);
        $synonyms = ['GET', 'HEAD'];
        if (array_intersect($synonyms, $methods)) {
            $methods = array_merge($methods, array_diff($synonyms, $methods));
        }
        return $methods;
    }
private function canonizeMethods ( $ methods ) { $ methods = array_map ( 'strtoupper' , is_array ( $ methods ) ? $ methods : [ $ methods ] ) ; if ( in_array ( current ( $ methods ) , [ '' , '*' , 'ANY' ] ) ) { return self :: $ httpMethods ; } $ methods = array_intersect ( $ methods , self :: $ httpMethods ) ; $ synonyms = [ 'GET' , 'HEAD' ] ; if ( array_intersect ( $ synonyms , $ methods ) ) { $ methods = array_merge ( $ methods , array_diff ( $ synonyms , $ methods ) ) ; } return $ methods ; }
Canonizes the list of methods to a standard format.
Canonizes the list of methods to a standard format .
// Any method that responds to GET must also respond to HEAD