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