mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 15:54:03 +02:00
Deprecate Module::registerHook() in favor of Module::provideHook()
refs #9685
This commit is contained in:
parent
8ba7b4142d
commit
8835552e80
@ -1238,13 +1238,15 @@ class Module
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register hook
|
* Register a hook
|
||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name Name of the hook
|
||||||
* @param string $class
|
* @param string $class Class of the hook w/ namespace
|
||||||
* @param string $key
|
* @param string $key
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated in favor of {@link provideHook()}. Will be removed in version 2.2.0
|
||||||
*/
|
*/
|
||||||
protected function registerHook($name, $class, $key = null)
|
protected function registerHook($name, $class, $key = null)
|
||||||
{
|
{
|
||||||
@ -1261,7 +1263,18 @@ class Module
|
|||||||
return implode('\\', $list);
|
return implode('\\', $list);
|
||||||
}
|
}
|
||||||
|
|
||||||
// deprecate $key
|
/**
|
||||||
|
* Provide a hook implementation
|
||||||
|
*
|
||||||
|
* @param string $name Name of the hook for which to provide an implementation
|
||||||
|
* @param string $implementation [optional] Fully qualified name of the class providing the hook implementation.
|
||||||
|
* Defaults to the module's ProvidedHook namespace plus the hook's name for the
|
||||||
|
* class name. Web 2's namespace separator is \\ (double backslash) at the moment
|
||||||
|
* @param string $key No-op arg for compatibility reasons. This argument is deprecated and will be
|
||||||
|
* removed in version 2.2.0
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
protected function provideHook($name, $implementation = null, $key = null)
|
protected function provideHook($name, $implementation = null, $key = null)
|
||||||
{
|
{
|
||||||
if ($implementation === null) {
|
if ($implementation === null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user