ServerRequestFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

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

1 Method

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