Completed
Push — master ( 93a9b6...fec7c1 )
by Tobias
02:09
created

UriFactory::createUri()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Nyholm\Psr7\Factory;
6
7
use Nyholm\Psr7\Uri;
8
use Psr\Http\Message\UriInterface;
9
10
/**
11
 * @author Tobias Nyholm <[email protected]>
12
 */
13
final class UriFactory implements \Http\Message\UriFactory
14
{
15
    public function createUri($uri = ''): UriInterface
16
    {
17
        if ($uri instanceof UriInterface) {
18
            return $uri;
19
        }
20
21
        return new Uri($uri);
22
    }
23
}
24