mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-09 23:14:25 +02:00
Hook classes: Add class suffix if not exist
refs #7066 refs #7067 refs #7068
This commit is contained in:
parent
eeed030bb5
commit
4fb47ef768
@ -123,7 +123,12 @@ class Hook
|
|||||||
*/
|
*/
|
||||||
private static function assertValidHook($instance, $name)
|
private static function assertValidHook($instance, $name)
|
||||||
{
|
{
|
||||||
$base_class = self::$BASE_NS . ucfirst($name) . self::$classSuffix;
|
$base_class = self::$BASE_NS . ucfirst($name);
|
||||||
|
|
||||||
|
if (strpos($base_class, self::$classSuffix) === false) {
|
||||||
|
$base_class .= 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