RequestHeaderMiddleware   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 13
rs 10
ccs 3
cts 3
cp 1
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A applyRequest() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of Guzzle HTTP JSON-RPC
5
 *
6
 * Copyright (c) 2014 Nature Delivered Ltd. <http://graze.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @see  http://github.com/graze/guzzle-jsonrpc/blob/master/LICENSE
12
 * @link http://github.com/graze/guzzle-jsonrpc
13
 */
14
15
namespace Graze\GuzzleHttp\JsonRpc\Middleware;
16
17
use Psr\Http\Message\RequestInterface as HttpRequestInterface;
18
19
class RequestHeaderMiddleware extends AbstractMiddleware
20
{
21
    /**
22
     * @param  HttpRequestInterface $request
23
     * @param  array                $options
24
     *
25
     * @return HttpRequestInterface
26
     */
27 1
    public function applyRequest(HttpRequestInterface $request, array $options)
28
    {
29
        return $request
30 1
            ->withHeader('Accept-Encoding', 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3')
31 1
            ->withHeader('Content-Type', 'application/json');
32
    }
33
}
34