src/Http/Helpers.php
public static function getMethod(array $server): string
    {
        $method = $server['REQUEST_METHOD'] ?? 'GET';
        if ($method === 'POST' &&
            isset(
                $server['HTTP_X_HTTP_METHOD_OVERRIDE'],
                self::$methods[$server['HTTP_X_HTTP_METHOD_OVERRIDE']]
            )
        ) {
            $method = $server['HTTP_X_HTTP_METHOD_OVERRIDE'];
        }

        return $method;
    }
public static function getMethod(array $server): string
    {
        $method = $server['REQUEST_METHOD'] ?? 'GET';
        if ($method === 'POST' &&
            isset(
                $server['HTTP_X_HTTP_METHOD_OVERRIDE'],
                self::$methods[$server['HTTP_X_HTTP_METHOD_OVERRIDE']]
            )
        ) {
            $method = $server['HTTP_X_HTTP_METHOD_OVERRIDE'];
        }

        return $method;
    }
public static function getMethod ( array $ server ) : string { $ method = $ server [ 'REQUEST_METHOD' ] ?? 'GET' ; if ( $ method === 'POST' && isset ( $ server [ 'HTTP_X_HTTP_METHOD_OVERRIDE' ] , self :: $ methods [ $ server [ 'HTTP_X_HTTP_METHOD_OVERRIDE' ] ] ) ) { $ method = $ server [ 'HTTP_X_HTTP_METHOD_OVERRIDE' ] ; } return $ method ; }
Get method from server variables.

@param array $server Typically $_SERVER or similar structure.

@return string
Get method from server variables .