diff --git a/src/Core/CustomMethods.php b/src/Core/CustomMethods.php index 97f84f07d64..619f551cba0 100644 --- a/src/Core/CustomMethods.php +++ b/src/Core/CustomMethods.php @@ -171,11 +171,14 @@ protected function getExtraMethodConfig($method) } // 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; } /**