Request   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace HttpSoft\Message;
6
7
use Psr\Http\Message\RequestInterface;
8
use Psr\Http\Message\StreamInterface;
9
use Psr\Http\Message\UriInterface;
10
11
final class Request implements RequestInterface
12
{
13
    use RequestTrait;
14
15
    /**
16
     * @param string $method The HTTP method.
17
     * @param UriInterface|string $uri The URI to request.
18
     * @param array $headers The headers to send with the request.
19
     * @param StreamInterface|string|resource|null $body The body of the request. Must be one of the following:
20
     *  - an instance of `StreamInterface`;
21
     *  - a string stream identifier (e.g., 'php://temp') or a file path;
22
     *  - a valid stream resource;
23
     *  - `null`.
24
     * @param string $protocol The HTTP protocol version.
25
     */
26 133
    public function __construct(
27
        string $method = 'GET',
28
        $uri = '',
29
        array $headers = [],
30
        $body = null,
31
        string $protocol = '1.1'
32
    ) {
33 133
        $this->init($method, $uri, $headers, $body, $protocol);
34
    }
35
}
36