Total Complexity | 9 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Coverage | 88.24% |
Changes | 0 |
1 | <?php |
||
7 | final class JoinTableMetadata extends TableMetadata |
||
8 | { |
||
9 | /** @var JoinColumnMetadata[] */ |
||
10 | protected $joinColumns = []; |
||
11 | |||
12 | /** @var JoinColumnMetadata[] */ |
||
13 | protected $inverseJoinColumns = []; |
||
14 | |||
15 | public function hasColumns() : bool |
||
16 | { |
||
17 | return $this->joinColumns || $this->inverseJoinColumns; |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * @return JoinColumnMetadata[] |
||
22 | */ |
||
23 | 464 | public function getJoinColumns() : array |
|
24 | { |
||
25 | 464 | return $this->joinColumns; |
|
26 | } |
||
27 | |||
28 | 90 | public function addJoinColumn(JoinColumnMetadata $joinColumn) : void |
|
29 | { |
||
30 | 90 | $this->joinColumns[] = $joinColumn; |
|
31 | 90 | } |
|
32 | |||
33 | /** |
||
34 | * @return JoinColumnMetadata[] |
||
35 | */ |
||
36 | 458 | public function getInverseJoinColumns() : array |
|
39 | } |
||
40 | |||
41 | 90 | public function addInverseJoinColumn(JoinColumnMetadata $joinColumn) : void |
|
44 | 90 | } |
|
45 | |||
46 | 7 | public function __clone() |
|
54 | } |
||
55 | 7 | } |
|
57 |
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.