RedirectResponse   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 20
ccs 3
cts 3
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace HttpSoft\Response;
6
7
use Psr\Http\Message\ResponseInterface;
8
9
final class RedirectResponse implements ResponseInterface, ResponseStatusCodeInterface
10
{
11
    use ResponseExtensionTrait;
12
13
    /**
14
     * @param string $uri
15
     * @param int $code
16
     * @param array $headers
17
     * @param string $protocol
18
     * @param string $reasonPhrase
19
     */
20 27
    public function __construct(
21
        string $uri,
22
        int $code = self::STATUS_FOUND,
23
        array $headers = [],
24
        string $protocol = '1.1',
25
        string $reasonPhrase = ''
26
    ) {
27 27
        $headers['Location'] = $uri;
28 27
        $this->init($code, $reasonPhrase, $headers, 'php://temp', $protocol);
29
    }
30
}
31