Passed
Pull Request — master (#9)
by Pavel
11:27
created

Response::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Bankiru\Api\Rpc\Test\Impl;
4
5
use ScayTrase\Api\Rpc\RpcErrorInterface;
6
use ScayTrase\Api\Rpc\RpcResponseInterface;
7
8
final class Response implements RpcResponseInterface
9
{
10
    private $body;
11
12
    /**
13
     * Response constructor.
14
     *
15
     * @param $body
16
     */
17 4
    public function __construct($body)
18
    {
19 4
        $this->body = $body;
20 4
    }
21
22
    /** @return bool */
23
    public function isSuccessful()
24
    {
25
        return true;
26
    }
27
28
    /** @return RpcErrorInterface|null */
29
    public function getError()
30
    {
31
        return null;
32
    }
33
34
    /** @return \stdClass|array|mixed|null */
35 4
    public function getBody()
36
    {
37 4
        return $this->body;
38
    }
39
}
40