Completed
Push — master ( 055f1b...f72a4b )
by Pavel
52s
created

Response   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 33.33%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 4
c 1
b 1
f 0
lcom 0
cbo 0
dl 0
loc 30
ccs 2
cts 6
cp 0.3333
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 1 1
A isSuccessful() 0 4 1
A getError() 0 4 1
A getBody() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: batanov.pavel
5
 * Date: 16.05.2016
6
 * Time: 13:53
7
 */
8
9
namespace Bankiru\Api\Rpc\Impl;
10
11
use ScayTrase\Api\Rpc\RpcErrorInterface;
12
use ScayTrase\Api\Rpc\RpcResponseInterface;
13
14
final class Response implements RpcResponseInterface
15
{
16
    private $body;
17
18
    /**
19
     * Response constructor.
20
     *
21
     * @param $body
22
     */
23
    public function __construct($body) { $this->body = $body; }
24
25
26
    /** @return bool */
27
    public function isSuccessful()
28
    {
29
        return true;
30
    }
31
32
    /** @return RpcErrorInterface|null */
33
    public function getError()
34
    {
35
        return null;
36
    }
37
38
    /** @return \stdClass|array|mixed|null */
39 3
    public function getBody()
40
    {
41 3
        return $this->body;
42
    }
43
}
44