RequestFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 3
c 1
b 0
f 0
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createRequest() 0 4 1
1
<?php
2
declare(strict_types=1);
3
namespace Bnf\Typo3HttpFactory;
4
5
use Psr\Http\Message\RequestFactoryInterface;
6
use Psr\Http\Message\RequestInterface;
7
use Psr\Http\Message\UriInterface;
8
use TYPO3\CMS\Core\Http\Request;
9
use TYPO3\CMS\Core\Http\Stream;
10
11
final class RequestFactory implements RequestFactoryInterface
12
{
13
    /**
14
     * @param string $method
15
     * @param UriInterface|string $uri
16
     */
17
    public function createRequest(string $method, $uri): RequestInterface
18
    {
19
        $stream = new Stream('php://temp', 'r+');
20
        return new Request($uri, $method, $stream);
21
    }
22
}
23