UnableBuildTreeException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

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