1 | <?php |
||
21 | final class InteractionComponent |
||
22 | { |
||
23 | private $id; |
||
24 | private $description; |
||
25 | |||
26 | /** |
||
27 | * @param string $id |
||
28 | * @param LanguageMap|null $description |
||
29 | */ |
||
30 | public function __construct($id, LanguageMap $description = null) |
||
35 | |||
36 | public function getId() |
||
40 | |||
41 | public function getDescription() |
||
45 | |||
46 | public function equals(InteractionComponent $interactionComponent) |
||
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: