ServerRequestFactory::createServerRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 2
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 3
1
<?php
2
declare(strict_types=1);
3
namespace Bnf\Typo3HttpFactory;
4
5
use Psr\Http\Message\ServerRequestFactoryInterface;
6
use Psr\Http\Message\ServerRequestInterface;
7
use TYPO3\CMS\Core\Http\ServerRequest;
8
use TYPO3\CMS\Core\Http\Stream;
9
10
final class ServerRequestFactory implements ServerRequestFactoryInterface
11
{
12
    public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface
13
    {
14
        $stream = new Stream('php://temp', 'r+');
15
        return new ServerRequest($uri, $method, $stream, [], $serverParams);
16
    }
17
}
18