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

UriFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 11
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createUri() 0 8 2
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