Completed
Push — master ( 5d3227...f942bf )
by Nils
07:32
created

RequestFactory::getRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 5
1
<?php
2
3
namespace whm\Smoke\Http;
4
5
use Ivory\HttpAdapter\Message\Request;
6
7
class RequestFactory
8
{
9
    private static $standardHeaders;
10
11
    public static function addStandardHeader($key, $value)
12
    {
13
        self::$standardHeaders[$key] = $value;
14
    }
15
16
    public static function getRequest($uri = null, $method = null, $body = 'php://memory', array $headers = array(), array $parameters = array())
17
    {
18
        $headers = array_merge(self::$standardHeaders, $headers);
19
20
        return new Request($uri, $method, $body, $headers, $parameters);
21
    }
22
}
23