Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
TreenodeFactory | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
makeNode | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | /** |
4 | * @author: Doug Wilbourne (dougwilbourne@gmail.com) |
5 | */ |
6 | declare(strict_types=1); |
7 | |
8 | namespace pvc\struct\tree\node; |
9 | |
10 | use pvc\interfaces\struct\tree\node\TreenodeChildCollectionFactoryInterface; |
11 | use pvc\interfaces\struct\tree\node\TreenodeFactoryInterface; |
12 | use pvc\interfaces\struct\tree\node\TreenodeInterface; |
13 | |
14 | /** |
15 | * Class TreenodeFactory |
16 | * |
17 | * @template TreenodeType of TreenodeInterface |
18 | * @implements TreenodeFactoryInterface<TreenodeType> |
19 | */ |
20 | class TreenodeFactory implements TreenodeFactoryInterface |
21 | { |
22 | /** |
23 | * @param TreenodeChildCollectionFactoryInterface<TreenodeType> $collectionFactory |
24 | */ |
25 | public function __construct( |
26 | protected TreenodeChildCollectionFactoryInterface $collectionFactory, |
27 | ) { |
28 | } |
29 | |
30 | /** |
31 | * @return Treenode<TreenodeType> |
32 | */ |
33 | public function makeNode(): Treenode |
34 | { |
35 | return new Treenode($this->collectionFactory); |
36 | } |
37 | } |