Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public function add(MediaItemImportDataTransferObject $mediaItemImportDataTransferObject): void |
||
32 | { |
||
33 | if ($this->hasExistingMediaGroup()) { |
||
34 | $mediaItemImportDataTransferObject->setMediaGroup($this->mediaGroupEntity); |
||
|
|||
35 | } |
||
36 | |||
37 | $this->mediaItemImportDataTransferObjects[] = $mediaItemImportDataTransferObject; |
||
38 | } |
||
39 | |||
55 |
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: