Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 12... Línea 12...
12
    /**
12
    /**
13
     * Returns the HTTP version, status code, reason phrase, and headers.
13
     * Returns the HTTP version, status code, reason phrase, and headers.
14
     *
14
     *
15
     * @param string[] $headers
15
     * @param string[] $headers
16
     *
16
     *
17
     * @throws \RuntimeException
-
 
18
     *
-
 
19
     * @return array{0:string, 1:int, 2:?string, 3:array}
17
     * @return array{0:string, 1:int, 2:?string, 3:array}
-
 
18
     *
-
 
19
     * @throws \RuntimeException
20
     */
20
     */
21
    public static function parseHeaders(array $headers): array
21
    public static function parseHeaders(array $headers): array
22
    {
22
    {
23
        if ($headers === []) {
23
        if ($headers === []) {
24
            throw new \RuntimeException('Expected a non-empty array of header data');
24
            throw new \RuntimeException('Expected a non-empty array of header data');