Skip to content

Commit 0fd0f9d

Browse files
committed
Deprecate Module#provideHook() and Hook methods in favor of Hook\Essentials ones
1 parent de50569 commit 0fd0f9d

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

library/Icinga/Application/Hook.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ public static function clean()
6666
* @param string $name One of the predefined hook names
6767
*
6868
* @return bool
69+
*
70+
* @deprecated Use {@link Hook\Essentials::registered} instead
6971
*/
7072
public static function has($name)
7173
{
@@ -265,6 +267,8 @@ private static function assertValidHook($instance, $name)
265267
* @param string $name One of the predefined hook names
266268
*
267269
* @return array
270+
*
271+
* @deprecated Use {@link Hook\Essentials::all} instead
268272
*/
269273
public static function all($name): array
270274
{
@@ -289,6 +293,8 @@ public static function all($name): array
289293
* @param string $name One of the predefined hook names
290294
*
291295
* @return null|mixed
296+
*
297+
* @deprecated Use {@link Hook\Essentials::first} instead
292298
*/
293299
public static function first($name)
294300
{
@@ -312,6 +318,8 @@ public static function first($name)
312318
* @param string $class Your class name, must inherit one of the
313319
* classes in the Icinga/Application/Hook folder
314320
* @param bool $alwaysRun To run the hook always (e.g. without permission check)
321+
*
322+
* @deprecated Use {@link Hook\Essentials::register} instead
315323
*/
316324
public static function register($name, $key, $class, $alwaysRun = false)
317325
{

library/Icinga/Application/Modules/Module.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,8 @@ protected function slashesToNamespace($class)
14151415
* @param bool $alwaysRun To run the hook always (e.g. without permission check)
14161416
*
14171417
* @return $this
1418+
*
1419+
* @deprecated Use {@link Hook\Essentials::register} instead
14181420
*/
14191421
protected function provideHook($name, $implementation = null, $alwaysRun = false)
14201422
{

0 commit comments

Comments
 (0)