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

RequestFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 15
c 0
b 0
f 0
ccs 2
cts 4
cp 0.5
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createRequest() 0 4 1
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