Conditions | 2 |
Paths | 2 |
Total Lines | 21 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 2.0094 |
Changes | 0 |
1 | <?php |
||
42 | 3 | public function format(OperationFailureInterface $failure): string |
|
43 | { |
||
44 | 3 | $exception = $failure->getException(); |
|
45 | 3 | $operation = $failure->getOperation(); |
|
46 | 3 | $identifier = str_pad( |
|
47 | 3 | sprintf('(%d)', spl_object_id($operation)), |
|
48 | 3 | 8, |
|
49 | 3 | ' ', |
|
50 | 3 | STR_PAD_RIGHT |
|
51 | ); |
||
52 | |||
53 | 3 | return $exception !== null |
|
54 | ? sprintf( |
||
55 | 2 | '%s ∴ %s', |
|
56 | $identifier, |
||
57 | 2 | $this->exceptionFormatter->format($exception) |
|
58 | ) |
||
59 | : sprintf( |
||
60 | 1 | '%s ✔ %s', |
|
61 | $identifier, |
||
62 | 3 | $this->operationFormatter->format($operation) |
|
63 | ); |
||
66 |