Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1425610
ProtectedHookAccessorTrait.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
926 B
Referenced Files
None
Subscribers
None
ProtectedHookAccessorTrait.php
View Options
<?php
namespace
MediaWiki\HookContainer
;
use
MediaWiki\MediaWikiServices
;
/**
* This trait provides an implementation of getHookContainer() and
* getHookRunner() for classes that do not use dependency injection. Its
* purpose is to provide a consistent API which can easily be maintained
* after the class has been migrated to dependency injection.
*/
trait
ProtectedHookAccessorTrait
{
/**
* Get a HookContainer, for running extension hooks or for hook metadata.
*
* @since 1.35
* @return HookContainer
*/
protected
function
getHookContainer
()
{
return
MediaWikiServices
::
getInstance
()->
getHookContainer
();
}
/**
* Get a HookRunner for running core hooks.
*
* @internal This is for use by core only. Hook interfaces may be removed
* without notice.
* @since 1.35
* @return HookRunner
*/
protected
function
getHookRunner
()
{
return
new
HookRunner
(
$this
->
getHookContainer
()
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 11:43 (15 h, 48 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
60/76/ad6e158e779fb6b9faaaf7d41f3d
Default Alt Text
ProtectedHookAccessorTrait.php (926 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment