Completed
Push — master ( 2d02b0...698bc6 )
by Thibaud
19:46 queued 17:30
created

functions.php ➔ uri()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 4
c 1
b 0
f 1
nc 2
nop 1
dl 0
loc 7
ccs 3
cts 3
cp 1
crap 2
rs 9.4285
1
<?php
2
3
/*
4
 * This file is part of alchemy/resource-component.
5
 *
6
 * (c) Alchemy <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
13
/**
14
 * @param string|\Alchemy\Resource\ResourceUri $uri A valid resource URI instance or string.
15
 * @return \Alchemy\Resource\ResourceUri
16
 */
17
function uri($uri) {
18 12
    if ($uri instanceof \Alchemy\Resource\ResourceUri) {
19 4
        return $uri;
20
    }
21
22 8
    return \Alchemy\Resource\ResourceUri::fromString($uri);
23
}
24