Skip to content

Commit

Permalink
Fix deprecations for version 5
Browse files Browse the repository at this point in the history
  • Loading branch information
zonky2 committed Oct 9, 2024
1 parent 0eed0db commit 4b9b74a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Subscribers/CalendarSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public static function getSubscribedEvents(): array
* @psalm-suppress UndefinedMagicPropertyAssignment
* @psalm-suppress UndefinedMagicPropertyFetch
* @psalm-suppress UndefinedConstant
* @psalm-suppress DeprecatedClass
*/
public function handleEvent(
GetCalendarEventEvent $event,
Expand Down Expand Up @@ -343,6 +344,7 @@ public function handleEvent(
$arrEvent = $eventModel->row();
$arrEvent['singleSRC'] = $objModel->path;

/** @psalm-suppress DeprecatedClass */
$addImageEvent = new AddImageToTemplateEvent($arrEvent, $objTemplate);

$eventDispatcher->dispatch($addImageEvent, ContaoEvents::CONTROLLER_ADD_IMAGE_TO_TEMPLATE);
Expand Down
2 changes: 2 additions & 0 deletions src/Subscribers/ControllerSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ public function handleAddEnclosureToTemplate(AddEnclosureToTemplateEvent $event)
* @return void
*
* @deprecated The event has been deprecated will get removed in version 5.
*
* @psalm-suppress DeprecatedClass
*/
public function handleAddImageToTemplate(AddImageToTemplateEvent $event): void
{
Expand Down
2 changes: 2 additions & 0 deletions src/Subscribers/NewsSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public static function getSubscribedEvents(): array
* @psalm-suppress UndefinedMagicPropertyAssignment
* @psalm-suppress UndefinedMagicPropertyFetch
* @psalm-suppress UndefinedConstant
* @psalm-suppress DeprecatedClass
*/
public function handleNews(GetNewsEvent $event, string $eventName, EventDispatcherInterface $eventDispatcher): void
{
Expand Down Expand Up @@ -250,6 +251,7 @@ public function handleNews(GetNewsEvent $event, string $eventName, EventDispatch

$arrArticle['singleSRC'] = $objModel->path;

/** @psalm-suppress DeprecatedClass */
$imageEvent = new AddImageToTemplateEvent($arrArticle, $objTemplate);

$eventDispatcher->dispatch($imageEvent, ContaoEvents::CONTROLLER_ADD_IMAGE_TO_TEMPLATE);
Expand Down

0 comments on commit 4b9b74a

Please sign in to comment.