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

UnableBuildTreeException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 31
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A getBadNodeIds() 0 3 1
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