Passed
Push — master ( 2745d9...2c1420 )
by Steve
02:38
created

FailedApplyingAllCompensations::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
4
namespace MeadSteve\Tale\Exceptions;
5
6
use Throwable;
7
8
class FailedApplyingAllCompensations extends \RuntimeException implements TaleException
9
{
10
    /**
11
     * @var Throwable[]
12
     */
13
    public $caughtExceptions;
14
15
    /**
16
     * FailedApplyingAllCompensations constructor.
17
     * @param \Throwable[] $caughtExceptions
18
     */
19
    public function __construct($caughtExceptions)
20
    {
21
        $previous = null;
22
        if (sizeof($caughtExceptions) == 1) {
23
            $previous = $caughtExceptions[0];
24
        }
25
        parent::__construct("Failed applying all compensation steps", 0, $previous);
26
        $this->caughtExceptions = $caughtExceptions;
27
    }
28
}
29