1 | <?php |
||
9 | class CreateImportForMediaGroupDataTransferObject |
||
10 | { |
||
11 | /** @var MediaGroup|null */ |
||
12 | private $mediaGroupEntity; |
||
13 | |||
14 | /** @var array|MediaItemImportDataTransferObject[] */ |
||
15 | public $mediaItemImportDataTransferObjects = []; |
||
16 | |||
17 | /** @var Type */ |
||
18 | public $type; |
||
19 | |||
20 | public function __construct(MediaGroup $mediaGroup = null) |
||
30 | |||
31 | public function add(MediaItemImportDataTransferObject $mediaItemImportDataTransferObject): void |
||
39 | |||
40 | public function getMediaGroupEntity(): MediaGroup |
||
44 | |||
45 | public function hasExistingMediaGroup(): bool |
||
49 | |||
50 | public function setMediaGroupEntity(MediaGroup $mediaGroup): void |
||
54 | } |
||
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: