Skip to content

Commit

Permalink
Resolver: better exception message (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek authored and dg committed Feb 28, 2020
1 parent 9e6be87 commit 9a9e6a0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/DI/Resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ public function resolveEntityType(Statement $statement): ?string

} elseif (is_string($entity)) { // class
if (!class_exists($entity)) {
if (interface_exists($entity)) {
throw new ServiceCreationException("Interface '$entity' can not be used as 'factory', did you mean 'implement'?");
}
throw new ServiceCreationException("Class $entity not found.");
}
return $entity;
Expand Down

0 comments on commit 9a9e6a0

Please sign in to comment.