1 | <?php |
||
10 | class EventCopied extends AbstractEvent implements AggregateCopiedEventInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $originalEventId; |
||
16 | |||
17 | /** |
||
18 | * @var CalendarInterface|Calendar |
||
19 | */ |
||
20 | private $calendar; |
||
21 | |||
22 | /** |
||
23 | * EventCopied constructor. |
||
24 | * @param string $eventId |
||
25 | * @param string $originalEventId |
||
26 | * @param CalendarInterface $calendar |
||
27 | */ |
||
28 | public function __construct( |
||
44 | |||
45 | /** |
||
46 | * @inheritdoc |
||
47 | */ |
||
48 | public function getParentAggregateId() |
||
52 | |||
53 | /** |
||
54 | * @return string |
||
55 | */ |
||
56 | public function getOriginalEventId() |
||
60 | |||
61 | /** |
||
62 | * @return CalendarInterface |
||
63 | */ |
||
64 | public function getCalendar() |
||
68 | |||
69 | /** |
||
70 | * @inheritdoc |
||
71 | */ |
||
72 | public function serialize() |
||
79 | |||
80 | /** |
||
81 | * @inheritdoc |
||
82 | */ |
||
83 | public static function deserialize(array $data) |
||
91 | } |
||
92 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: