Passed
Push — master ( da8b21...2a5776 )
by hugh
02:15
created

UnableBuildTreeException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 4
dl 0
loc 9
rs 10
1
<?php
2
3
namespace HughCube\HTree\Exceptions;
4
5
use Throwable;
6
7
/**
8
 * Class InvalidArgumentException
9
 * @package HughCube\HTree\Exceptions
10
 */
11
class UnableBuildTreeException extends InvalidArgumentException
12
{
13
    /**
14
     * @var array 不正确的数据id
15
     */
16
    protected $badNodeIds = [];
17
18
    /**
19
     * UnableBuildTreeException constructor.
20
     * @param array $badIds
21
     * @param string $message
22
     * @param int $code
23
     * @param Throwable|null $previous
24
     */
25
    public function __construct(
26
        array $badIds,
27
        $message = "",
28
        $code = 0,
29
        Throwable $previous = null
30
    ) {
31
        $this->badNodeIds = $badIds;
32
33
        parent::__construct($message, $code, $previous);
34
    }
35
36
    /**
37
     * @return integer[]|string[]
38
     */
39
    public function getBadNodeIds()
40
    {
41
        return $this->badNodeIds;
42
    }
43
}
44