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

RequestFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createRequest() 0 3 1
1
<?php
2
/**
3
 * Class RequestFactory
4
 *
5
 * @filesource   RequestFactory.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\Request;
16
use Fig\Http\Message\RequestMethodInterface;
17
use Psr\Http\Message\{RequestFactoryInterface, RequestInterface};
18
19
class RequestFactory implements RequestFactoryInterface, RequestMethodInterface{
20
21
	/**
22
	 * Create a new request.
23
	 *
24
	 * @param string                                $method The HTTP method associated with the request.
25
	 * @param \Psr\Http\Message\UriInterface|string $uri    The URI associated with the request. If
26
	 *                                                      the value is a string, the factory MUST create a
27
	 *                                                      UriInterface instance based on it.
28
	 *
29
	 * @return \Psr\Http\Message\RequestInterface|\chillerlan\HTTP\Psr7\Request
30
	 */
31
	public function createRequest(string $method, $uri):RequestInterface{
32
		return new Request($method, $uri);
33
	}
34
35
}
36