Completed
Pull Request — master (#127)
by Alexandr
04:03
created

AbstractRequest::buildQuery()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Kerox\Messenger\Request;
6
7
use GuzzleHttp\Psr7\Request;
8
use GuzzleHttp\Psr7\Uri;
9
use Psr\Http\Message\RequestInterface;
10
11
abstract class AbstractRequest
12
{
13
    /**
14
     * @var RequestInterface
15
     */
16
    protected $origin;
17
18
    /**
19
     * AbstractRequest constructor.
20
     *
21
     * @param string $path
22
     */
23 23
    public function __construct(string $path)
24
    {
25 23
        $this->origin = new Request('get', Uri::fromParts(['path' => $path]));
26 23
    }
27
28
    /**
29
     * @param string|null $method
30
     *
31
     * @return RequestInterface
32
     */
33
    abstract public function build(?string $method = null): RequestInterface;
34
}
35