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

UriFactory::createUriFromArray()   B

Complexity

Conditions 9
Paths 72

Size

Total Lines 30

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 14.6564

Importance

Changes 0
Metric Value
dl 0
loc 30
ccs 10
cts 17
cp 0.5881
rs 8.0555
c 0
b 0
f 0
cc 9
nc 72
nop 1
crap 14.6564
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