| 1 | <?php |
||
| 9 | class EventCopied extends AbstractEvent |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | private $originalEventId; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var CalendarInterface|Calendar |
||
| 18 | */ |
||
| 19 | private $calendar; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * EventCopied constructor. |
||
| 23 | * @param string $eventId |
||
| 24 | * @param string $originalEventId |
||
| 25 | * @param CalendarInterface $calendar |
||
| 26 | */ |
||
| 27 | public function __construct( |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return string |
||
| 40 | */ |
||
| 41 | public function getOriginalEventId() |
||
| 42 | { |
||
| 43 | return $this->originalEventId; |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @return CalendarInterface |
||
| 48 | */ |
||
| 49 | public function getCalendar() |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @inheritdoc |
||
| 56 | */ |
||
| 57 | public function serialize() |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @inheritdoc |
||
| 67 | */ |
||
| 68 | public static function deserialize(array $data) |
||
| 76 | } |
||
| 77 |
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: