Completed
Push — master ( 78d4e7...979ecb )
by smiley
02:57
created

UriFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A createUri() 0 3 1
1
<?php
2
/**
3
 * Class UriFactory
4
 *
5
 * @filesource   UriFactory.php
6
 * @created      27.08.2018
7
 * @package      chillerlan\HTTP\Psr17
8
 * @author       smiley <[email protected]>
9
 * @copyright    2018 smiley
10
 * @license      MIT
11
 */
12
13
namespace chillerlan\HTTP\Psr17;
14
15
use chillerlan\HTTP\Psr7\Uri;
16
use Psr\Http\Message\{UriFactoryInterface, UriInterface};
17
18
final class UriFactory implements UriFactoryInterface{
19
20
	/**
21
	 * Create a new URI.
22
	 *
23
	 * @param string $uri
24
	 *
25
	 * @return \Psr\Http\Message\UriInterface|\chillerlan\HTTP\Psr7\Uri
26
	 *
27
	 * @throws \InvalidArgumentException If the given URI cannot be parsed.
28
	 */
29
	public function createUri(string $uri = ''):UriInterface{
30
		return new Uri($uri);
31
	}
32
33
}
34