Passed
Pull Request — master (#14)
by Pavel
03:16
created

ApiCallException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 12
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A callFailed() 0 4 1
A unexpectedResponse() 0 4 1
1
<?php
2
3
namespace Bankiru\Api\Doctrine\Exception;
4
5
use ScayTrase\Api\Rpc\Exception\RemoteCallFailedException;
6
use ScayTrase\Api\Rpc\RpcErrorInterface;
7
8
class ApiCallException extends RemoteCallFailedException implements DoctrineApiException
9
{
10
    public static function callFailed(RpcErrorInterface $error)
11
    {
12
        return new static(sprintf('RPC call was not successful: %s', $error->getMessage()));
13
    }
14
15
    public static function unexpectedResponse()
16
    {
17
        return new static('RPC call was successful but contains unexpected response');
18
    }
19
}
20