Skip to content

Commit

Permalink
#8 Fix resolving factory of type class-string
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackBonjour committed Oct 23, 2024
1 parent 227e3de commit 5696964
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ServiceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private function getFactory(string $id): FactoryInterface|callable
if (is_string($resolvableFactory) && class_exists($resolvableFactory)) {
$factory = new $resolvableFactory();

if ($factory instanceof FactoryInterface) {
if ($factory instanceof FactoryInterface || is_callable($factory)) {
$this->resolvedFactories[$id] = $factory;

return $factory;
Expand Down

0 comments on commit 5696964

Please sign in to comment.