mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 17:24:16 +02:00
parent
87a5967501
commit
e0d7c3855d
@ -41,6 +41,15 @@ class Hook
|
|||||||
*/
|
*/
|
||||||
public static $BASE_NS = 'Icinga\\Web\\Hook\\';
|
public static $BASE_NS = 'Icinga\\Web\\Hook\\';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Append this string to base class
|
||||||
|
*
|
||||||
|
* All base classes renamed to *Hook
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public static $classSuffix = 'Hook';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reset object state
|
* Reset object state
|
||||||
*/
|
*/
|
||||||
@ -114,7 +123,7 @@ class Hook
|
|||||||
*/
|
*/
|
||||||
private static function assertValidHook($instance, $name)
|
private static function assertValidHook($instance, $name)
|
||||||
{
|
{
|
||||||
$base_class = self::$BASE_NS . ucfirst($name);
|
$base_class = self::$BASE_NS . ucfirst($name) . self::$classSuffix;
|
||||||
if (!$instance instanceof $base_class) {
|
if (!$instance instanceof $base_class) {
|
||||||
throw new ProgrammingError(
|
throw new ProgrammingError(
|
||||||
'%s is not an instance of %s',
|
'%s is not an instance of %s',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user