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)
|
||||
{
|
||||
$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) {
|
||||
throw new ProgrammingError(
|
||||
'%s is not an instance of %s',
|
||||
|
|
Loading…
Reference in New Issue