MediaWiki  master
StaticHookRegistry.php
Go to the documentation of this file.
1 <?php
2 
4 
9 class StaticHookRegistry implements HookRegistry {
11  private $globalHooks;
12 
14  private $extensionHooks;
15 
17  private $deprecatedHooks;
18 
27  public function __construct(
28  array $globalHooks = [],
29  array $extensionHooks = [],
30  array $deprecatedHooksArray = []
31  ) {
32  $this->globalHooks = $globalHooks;
33  $this->extensionHooks = $extensionHooks;
34  $this->deprecatedHooks = new DeprecatedHooks( $deprecatedHooksArray );
35  }
36 
37  public function getGlobalHooks() {
38  return $this->globalHooks;
39  }
40 
41  public function getExtensionHooks() {
42  return $this->extensionHooks;
43  }
44 
48  public function getDeprecatedHooks() {
49  return $this->deprecatedHooks;
50  }
51 }
This is a simple immutable HookRegistry which can be used to set up a local HookContainer in tests an...
getGlobalHooks()
Get the current contents of the $wgHooks variable or a mocked substitute.
getExtensionHooks()
Get the current contents of the Hooks attribute in the ExtensionRegistry.
__construct(array $globalHooks=[], array $extensionHooks=[], array $deprecatedHooksArray=[])