diff --git a/framework/core/src/Extend/Conditional.php b/framework/core/src/Extend/Conditional.php index f9098430a0..55584beebe 100644 --- a/framework/core/src/Extend/Conditional.php +++ b/framework/core/src/Extend/Conditional.php @@ -82,15 +82,12 @@ public function extend(Container $container, Extension $extension = null) if ($condition['condition']) { $extenders = $condition['extenders']; - if (is_string($extenders) && class_exists($extenders) && method_exists($extenders, '__invoke')) { - $result = $container->call($extenders); - $extenders = is_array($result) ? $result : [$result]; + if (is_string($extenders)) { + $extenders = $container->call($extenders); } elseif (is_callable($extenders)) { $extenders = $container->call($extenders); } - assert(is_array($extenders), 'Extenders should be an array after resolution.'); - foreach ($extenders as $extender) { $extender->extend($container, $extension); }