An error occurred during processing; checking has been aborted. The error message was: implode(): Passing glue string after array is deprecated. Swap the parameters in /home/scrutinizer/build/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php on line 468
Loading history...
2
/**
3
* Copyright MediaCT. All rights reserved.
4
* https://www.mediact.nl
5
*/
6
7
namespace Johmanx10\Transaction\Exception;
8
9
use Johmanx10\Transaction\OperationFailureInterface;
10
use RuntimeException;
11
12
class TransactionRolledBackException extends RuntimeException implements TransactionRolledBackExceptionInterface
13
{
14
/** @var OperationFailureInterface[] */
15
private array $failures;
16
17
/**
18
* Constructor.
19
*
20
* @param OperationFailureInterface ...$failures
21
*/
22
3
public function __construct(OperationFailureInterface ...$failures)
23
{
24
3
$this->failures = $failures;
25
26
3
parent::__construct(
27
sprintf(
28
3
'%d operations were rolled back: %s',
29
3
count($failures),
30
implode(
31
3
', ',
32
array_map(
33
function (OperationFailureInterface $failure): int {