Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 84... Línea 84...
84
    /** @var int */
84
    /** @var int */
85
    private $statusCode;
85
    private $statusCode;
Línea 86... Línea 86...
86
 
86
 
87
    /**
87
    /**
88
     * @param int                                  $status  Status code
88
     * @param int                                  $status  Status code
89
     * @param array<string, string|string[]>       $headers Response headers
89
     * @param (string|string[])[]                  $headers Response headers
90
     * @param string|resource|StreamInterface|null $body    Response body
90
     * @param string|resource|StreamInterface|null $body    Response body
91
     * @param string                               $version Protocol version
91
     * @param string                               $version Protocol version
92
     * @param string|null                          $reason  Reason phrase (when empty a default will be used based on the status code)
92
     * @param string|null                          $reason  Reason phrase (when empty a default will be used based on the status code)
93
     */
93
     */
94
    public function __construct(
94
    public function __construct(
95
        int $status = 200,
95
        int $status = 200,
96
        array $headers = [],
96
        array $headers = [],
97
        $body = null,
97
        $body = null,
98
        string $version = '1.1',
98
        string $version = '1.1',
99
        string $reason = null
99
        ?string $reason = null
100
    ) {
100
    ) {
Línea 101... Línea 101...
101
        $this->assertStatusCodeRange($status);
101
        $this->assertStatusCodeRange($status);
Línea 136... Línea 136...
136
        $new->statusCode = $code;
136
        $new->statusCode = $code;
137
        if ($reasonPhrase == '' && isset(self::PHRASES[$new->statusCode])) {
137
        if ($reasonPhrase == '' && isset(self::PHRASES[$new->statusCode])) {
138
            $reasonPhrase = self::PHRASES[$new->statusCode];
138
            $reasonPhrase = self::PHRASES[$new->statusCode];
139
        }
139
        }
140
        $new->reasonPhrase = (string) $reasonPhrase;
140
        $new->reasonPhrase = (string) $reasonPhrase;
-
 
141
 
141
        return $new;
142
        return $new;
142
    }
143
    }
Línea 143... Línea 144...
143
 
144
 
144
    /**
145
    /**