Completed
Push — PSR-11-2 ( a5ad88...7f5041 )
by Nikolaos
03:59
created

RequestFactory::createRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1.125

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 4
cp 0.5
rs 10
cc 1
nc 1
nop 2
crap 1.125
1
<?php
2
3
/**
4
 * This file is part of the Phalcon Framework.
5
 *
6
 * (c) Phalcon Team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE.txt
9
 * file that was distributed with this source code.
10
 *
11
 * Implementation of this file has been influenced by Zend Diactoros
12
 *
13
 * @link    https://github.com/zendframework/zend-diactoros
14
 * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md
15
 */
16
17
declare(strict_types=1);
18
19
namespace Phalcon\Http\Message;
20
21
use Psr\Http\Message\RequestFactoryInterface;
22
use Psr\Http\Message\RequestInterface;
23
use Psr\Http\Message\UriInterface;
24
25
/**
26
 * PSR-17 RequestFactory
27
 */
28
final class RequestFactory implements RequestFactoryInterface
29
{
30
    /**
31
     * Create a new request.
32
     *
33
     * @param string                   $method
34
     * @param UriInterface|string|null $uri
35
     *
36
     * @return RequestInterface
37
     */
38 1
    public function createRequest(string $method, $uri): RequestInterface
39
    {
40 1
        return new Request($method, $uri);
41
    }
42
}
43