RequestHeaderMiddleware::applyRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
ccs 3
cts 3
cp 1
crap 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