Total Complexity | 4 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class TraverseBranchContext implements TraverseBranchContextInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var int current branch index |
||
16 | */ |
||
17 | protected int $index; |
||
18 | /** |
||
19 | * @var int|null parent branch index |
||
20 | */ |
||
21 | protected ?int $parentIndex; |
||
22 | /** |
||
23 | * @var VertexInterface vertex instance which started current branch |
||
24 | */ |
||
25 | protected VertexInterface $start; |
||
26 | |||
27 | /** |
||
28 | * TraverseBranchContext constructor |
||
29 | * @param int $index current branch index |
||
30 | * @param int|null $parentIndex parent branch index |
||
31 | * @param VertexInterface $start vertex instance which started current branch |
||
32 | */ |
||
33 | public function __construct( |
||
34 | int $index, |
||
35 | ?int $parentIndex, |
||
36 | VertexInterface $start |
||
37 | ) { |
||
38 | $this->index = $index; |
||
39 | $this->parentIndex = $parentIndex; |
||
40 | $this->start = $start; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @inheritDoc |
||
45 | */ |
||
46 | public function getIndex(): int |
||
47 | { |
||
48 | return $this->index; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @inheritDoc |
||
53 | */ |
||
54 | public function getParentIndex(): ?int |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @inheritDoc |
||
61 | */ |
||
62 | public function getStart(): VertexInterface |
||
65 | } |
||
66 | } |
||
67 |