Skip to content

Conversation

@IanDelMar
Copy link
Contributor

The $callback parameter of register_activation_hook(), register_deactivation_hook(), and register_uninstall_hook() is added to:

  • Activation: do_action("activate_{$plugin}", bool $network_wide) - reference
  • Deactivation: do_action("deactivate_{$plugin}", bool $network_deactivating) - reference
  • Uninstall: do_action("uninstall_{$file}") - reference

Accordingly, the callable types are narrowed to:

  • Activation: callable(bool): void
  • Deactivation: callable(bool): void
  • Uninstall: callable(): void

@szepeviktor
Copy link
Member

szepeviktor commented Oct 29, 2025

Don't we need parens?
@phpstan-param (callable(bool): void) $callback

@IanDelMar
Copy link
Contributor Author

No: https://phpstan.org/r/91ab018f-1be8-43c6-b571-67faa06d577d

@szepeviktor szepeviktor merged commit 8335bba into php-stubs:master Oct 29, 2025
7 checks passed
@IanDelMar IanDelMar deleted the register_activation_hook branch October 29, 2025 12:11
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.

2 participants