MediaWiki master
StaticHookRegistry.php
Go to the documentation of this file.
1<?php
2
4
10 private readonly DeprecatedHooks $deprecatedHooks;
11
20 public function __construct(
21 private readonly array $globalHooks = [],
22 private readonly array $extensionHooks = [],
23 array $deprecatedHooksArray = [],
24 ) {
25 $this->deprecatedHooks = new DeprecatedHooks( $deprecatedHooksArray );
26 }
27
29 public function getGlobalHooks() {
30 return $this->globalHooks;
31 }
32
34 public function getExtensionHooks() {
35 return $this->extensionHooks;
36 }
37
41 public function getDeprecatedHooks() {
42 return $this->deprecatedHooks;
43 }
44}
This is a simple immutable HookRegistry which can be used to set up a local HookContainer in tests an...
__construct(private readonly array $globalHooks=[], private readonly array $extensionHooks=[], array $deprecatedHooksArray=[],)
getGlobalHooks()
Get the current contents of the $wgHooks variable or a mocked substitute.array
getExtensionHooks()
Get the current contents of the Hooks attribute in the ExtensionRegistry.The contents is extended and...