Total Complexity | 2 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Coverage | 93.33% |
Changes | 0 |
1 | <?php |
||
12 | class RollbackFormatter implements RollbackFormatterInterface |
||
13 | { |
||
14 | private OperationFailureFormatterInterface $failureFormatter; |
||
15 | |||
16 | /** |
||
17 | * Constructor. |
||
18 | * |
||
19 | * @param OperationFailureFormatterInterface|null $failureFormatter |
||
20 | */ |
||
21 | 1 | public function __construct( |
|
22 | OperationFailureFormatterInterface $failureFormatter = null |
||
23 | ) { |
||
24 | 1 | $this->failureFormatter = ( |
|
25 | 1 | $failureFormatter ?? new OperationFailureFormatter() |
|
26 | ); |
||
27 | 1 | } |
|
28 | |||
29 | /** |
||
30 | * Format the given rollback exception into a readable string. |
||
31 | * |
||
32 | * @param TransactionRolledBackExceptionInterface $rollback |
||
33 | * |
||
34 | * @return string |
||
35 | */ |
||
36 | 2 | public function format( |
|
55 | ] |
||
56 | ) |
||
60 |