Completed
Pull Request — master (#14)
by Pavel
03:24
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\RpcResponseInterface;
6
7
class ApiCallException extends \RuntimeException implements DoctrineApiException
8
{
9
    public static function callFailed(RpcResponseInterface $response)
10
    {
11
        return new static(
12
            sprintf('RPC Call failed: %s', $response->getError())
13
        );
14
    }
15
}
16