diff --git a/src/Resolver.php b/src/Resolver.php new file mode 100644 index 0000000..b163900 --- /dev/null +++ b/src/Resolver.php @@ -0,0 +1,61 @@ +get($class); + } else { + $reflectionClass = new \ReflectionClass($class); + + $constructor = $reflectionClass->getConstructor(); + + if (null === $constructor) { + return $reflectionClass->newInstance($args); + } + throw new \RuntimeException("You must use psr/container to resolve class dependencies in $class"); + } + } +}