FIX Call defineMethods if lower method is missing

This commit is contained in:
Steve Boyd 2024-10-21 18:21:16 +13:00
parent ba97de9458
commit 89213c90ec

View File

@ -171,11 +171,14 @@ trait CustomMethods
}
// Lazy define methods
$lowerClass = strtolower(static::class);
if (!isset(self::class::$extra_methods[$lowerClass])) {
$lowerMethod = strtolower($method);
if (!array_key_exists($lowerClass, self::class::$extra_methods)
|| !array_key_exists($lowerMethod, self::class::$extra_methods[$lowerClass])
) {
$this->defineMethods();
}
return self::class::$extra_methods[$lowerClass][strtolower($method)] ?? null;
return self::class::$extra_methods[$lowerClass][$lowerMethod] ?? null;
}
/**