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

Response   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 55.56%

Importance

Changes 0
Metric Value
dl 0
loc 32
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0
ccs 5
cts 9
cp 0.5556
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isSuccessful() 0 4 1
A getError() 0 4 1
A getBody() 0 4 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