Total Complexity | 7 |
Total Lines | 69 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class AssociationTreeBuilder |
||
10 | { |
||
11 | /** |
||
12 | * @var NodeBuilder |
||
13 | */ |
||
14 | protected $nodeBuilder; |
||
15 | |||
16 | /** |
||
17 | * @var NodeInterface |
||
18 | */ |
||
19 | protected $rootNode; |
||
20 | |||
21 | /** |
||
22 | * @var bool |
||
23 | */ |
||
24 | protected $isAllowedToAlterAssociation; |
||
25 | |||
26 | /** |
||
27 | * @var NodeInterface[] |
||
28 | */ |
||
29 | protected $divergeNodes = []; |
||
30 | |||
31 | public function __construct() |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @throws \Exception |
||
40 | */ |
||
41 | public function associate(string $relationshipName): self |
||
47 | } |
||
48 | |||
49 | public function diverge(): self |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @throws \Exception |
||
59 | */ |
||
60 | public function endDiverge(): self |
||
73 | } |
||
74 | |||
75 | public function create(): AssociationTree |
||
80 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.