RequestFactory::createRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace DMT\Aura\Psr\Factory;
4
5
use DMT\Aura\Psr\Message\Request;
6
use Psr\Http\Message\RequestFactoryInterface;
7
use Psr\Http\Message\RequestInterface;
8
use Psr\Http\Message\UriInterface;
9
10
/**
11
 * Class RequestFactory
12
 *
13
 * @package DMT\Aura\Psr\Factory
14
 */
15
class RequestFactory implements RequestFactoryInterface
16
{
17
    /**
18
     * Create a new request.
19
     *
20
     * @param string $method The HTTP method associated with the request.
21
     * @param UriInterface|string $uri The URI associated with the request. If
22
     *     the value is a string, the factory MUST create a UriInterface
23
     *     instance based on it.
24
     *
25
     * @return RequestInterface
26
     */
27 38
    public function createRequest(string $method, $uri): RequestInterface
28
    {
29 38
        return new Request($method, $uri);
30
    }
31
}