Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2][Events] Use event classes for Extension plugins #43617

Merged
merged 8 commits into from
Aug 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
extension override
  • Loading branch information
Fedik committed Jun 4, 2024
commit 745b4b46b7351211e18eca5290970af16e1a27f8
22 changes: 21 additions & 1 deletion plugins/installer/override/src/Extension/Override.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\Database\DatabaseAwareTrait;
use Joomla\Database\ParameterType;
use Joomla\Event\SubscriberInterface;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand All @@ -25,7 +26,7 @@
*
* @since 4.0.0
*/
final class Override extends CMSPlugin
final class Override extends CMSPlugin implements SubscriberInterface
{
use DatabaseAwareTrait;

Expand All @@ -38,6 +39,25 @@ final class Override extends CMSPlugin
*/
protected $autoloadLanguage = true;

/**
* Returns an array of events this subscriber will listen to.
*
* @return array
*
* @since __DEPLOY_VERSION__
*/
public static function getSubscribedEvents(): array
{
return [
'onExtensionBeforeUpdate' => 'onExtensionBeforeUpdate',
'onExtensionAfterUpdate' => 'onExtensionAfterUpdate',
'onJoomlaBeforeUpdate' => 'onJoomlaBeforeUpdate',
'onJoomlaAfterUpdate' => 'onJoomlaAfterUpdate',
'onInstallerBeforeInstaller' => 'onInstallerBeforeInstaller',
'onInstallerAfterInstaller' => 'onInstallerAfterInstaller',
];
}

/**
* Method to get com_templates model instance.
*
Expand Down