Completed
Pull Request — master (#14)
by Pavel
03:40
created

ApiCallException::callFailed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
ccs 0
cts 6
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Bankiru\Api\Doctrine\Exception;
4
5
use ScayTrase\Api\Rpc\Exception\RemoteCallFailedException;
6
use ScayTrase\Api\Rpc\RpcResponseInterface;
7
8
class ApiCallException extends RemoteCallFailedException implements DoctrineApiException
9
{
10
    public static function callFailed(RpcResponseInterface $response)
11
    {
12
        return new static(
13
            sprintf('RPC Call failed: %s', $response->getError())
14
        );
15
    }
16
}
17