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

Fix deprecated class Hooks replaced by HookContainer #82

Closed
wants to merge 1 commit into from

Conversation

Seb35
Copy link

@Seb35 Seb35 commented Aug 1, 2024

Regarding this commit, I kept the compatibility with MW 1.31, else without the compatibility part the extension should be marked MW 1.35+.

Fixes #75

This PR includes:

  • Tests (unit/integration)
  • CI build passed
  • Tested with MW 1.41

@@ -33,8 +34,15 @@ public function __construct( Store $store, Options $options ) {
* @since 1.0
*/
public function register() {
foreach ( $this->handlers as $name => $callback ) {
Hooks::register( $name, $callback );
if ( class_exists( 'MediaWiki\HookContainer\HookContainer' ) ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using HookContainer::class is better. This works even if the class does not exist.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the check needed at all? I see HookContainer was added in MW 35

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the check needed at all? I see HookContainer was added in MW 35

No it is not needed.

@paladox
Copy link
Contributor

paladox commented Jan 10, 2025

This was done in 4e180f1

@paladox paladox closed this Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace deprecated Hooks::register / Hooks::isRegistered
4 participants