UnableBuildTreeException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 32
ccs 5
cts 5
cp 1
rs 10
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
 */
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