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

RequestFactory::addStandardHeader()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
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