Completed
Push — master ( 38938d...e04383 )
by BENOIT
01:01
created

functions.php ➔ request_uri()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace BenTools\UriFactory\Helper;
4
5
use BenTools\UriFactory\UriFactory;
6
use BenTools\UriFactory\UriFactoryInterface;
7
use Psr\Http\Message\UriInterface;
8
9
/**
10
 * @param string $uri
11
 * @param UriFactoryInterface|null $factory
12
 * @return UriInterface
13
 */
14
function uri(string $uri, UriFactoryInterface $factory = null): UriInterface
15
{
16
    return UriFactory::factory()->createUri($uri, $factory);
17
}
18
19
/**
20
 * @param UriFactoryInterface|null $factory
21
 * @return UriInterface
22
 */
23
function current_location(UriFactoryInterface $factory = null): UriInterface
24
{
25
    return UriFactory::factory()->createUriFromCurrentLocation($factory);
26
}
27