Update conditional logic when checking array keys before removing methods in CustomMethods

This commit is contained in:
Michal Kleiner 2019-09-30 10:17:59 +13:00
parent 52a039f631
commit 1a2dbfd3a5
No known key found for this signature in database
GPG Key ID: CFCE9D1A56C919C0

View File

@ -288,8 +288,8 @@ trait CustomMethods
if (
// always check for property
(isset($methodInfo['property']) && $methodInfo['property'] === $property) &&
// check for index only if provided (otherwise assume true)
(($index && isset($methodInfo['index']) && $methodInfo['index'] === $index) || true)
// check for index only if provided
(!$index || ($index && isset($methodInfo['index']) && $methodInfo['index'] === $index))
) {
unset(self::$extra_methods[$class][$method]);
}