| Conditions | 5 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | public function equals(InteractionComponent $interactionComponent) |
||
| 47 | { |
||
| 48 | if ($this->id !== $interactionComponent->id) { |
||
| 49 | return false; |
||
| 50 | } |
||
| 51 | |||
| 52 | if (null !== $this->description xor null !== $interactionComponent->description) { |
||
| 53 | return false; |
||
| 54 | } |
||
| 55 | |||
| 56 | if (null !== $this->description && !$this->description->equals($interactionComponent->description)) { |
||
|
|
|||
| 57 | return false; |
||
| 58 | } |
||
| 59 | |||
| 60 | return true; |
||
| 61 | } |
||
| 62 | } |
||
| 63 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: