RequestFactory::createRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 2
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