private static function verbs(array $methods)
    {
        $list = array();
        $reMatch = '#^(any|get|post|patch|put|head|delete|options|trace|connect)([A-Z0-9]\w+)$#';

        foreach ($methods as $value) {
            $verb = array();

            if (preg_match($reMatch, $value, $verb)) {
                if (strcasecmp('index', $verb[2]) === 0) {
                    $verb[2] = '';
                } else {
                    $verb[2] = strtolower(preg_replace('#([a-z])([A-Z])#', '$1-$2', $verb[2]));
                }

                $list[] = array(strtoupper($verb[1]), $verb[2], $value);
            }
        }

        return $list;
    }
private static function verbs(array $methods)
    {
        $list = array();
        $reMatch = '#^(any|get|post|patch|put|head|delete|options|trace|connect)([A-Z0-9]\w+)$#';

        foreach ($methods as $value) {
            $verb = array();

            if (preg_match($reMatch, $value, $verb)) {
                if (strcasecmp('index', $verb[2]) === 0) {
                    $verb[2] = '';
                } else {
                    $verb[2] = strtolower(preg_replace('#([a-z])([A-Z])#', '$1-$2', $verb[2]));
                }

                $list[] = array(strtoupper($verb[1]), $verb[2], $value);
            }
        }

        return $list;
    }
private static function verbs ( array $ methods ) { $ list = array ( ) ; $ reMatch = '#^(any|get|post|patch|put|head|delete|options|trace|connect)([A-Z0-9]\w+)$#' ; foreach ( $ methods as $ value ) { $ verb = array ( ) ; if ( preg_match ( $ reMatch , $ value , $ verb ) ) { if ( strcasecmp ( 'index' , $ verb [ 2 ] ) === 0 ) { $ verb [ 2 ] = '' ; } else { $ verb [ 2 ] = strtolower ( preg_replace ( '#([a-z])([A-Z])#' , '$1-$2' , $ verb [ 2 ] ) ) ; } $ list [ ] = array ( strtoupper ( $ verb [ 1 ] ) , $ verb [ 2 ] , $ value ) ; } } return $ list ; }
Extract valid methods

@param array $methods Methods of \Controller class
@return array
Extract valid methods