GuzzleTransportResponse::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/*
3
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * This software consists of voluntary contributions made by many individuals
16
 * and is licensed under the MIT license.
17
 */
18
namespace Elastification\Client\Transport\HttpGuzzle;
19
20
use Elastification\Client\Transport\TransportResponseInterface;
21
use Psr\Http\Message\ResponseInterface;
22
23
/**
24
 * @package Elastification\Client\Transport\HttpGuzzle
25
 * @author  Mario Mueller
26
 */
27
class GuzzleTransportResponse implements TransportResponseInterface
28
{
29
    /**
30
     * @var ResponseInterface
31
     */
32
    private $guzzleResponse;
33
34
    /**
35
     * @param ResponseInterface $guzzleResponse
36
     */
37 2
    function __construct(ResponseInterface $guzzleResponse)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
38
    {
39 2
        $this->guzzleResponse = $guzzleResponse;
40 2
    }
41
42
    /**
43
     * @return string The raw response string.
44
     * @author Mario Mueller
45
     */
46 1
    public function getBody()
47
    {
48 1
        return (string)$this->guzzleResponse->getBody();
49
    }
50
}
51