diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a48d4d..20184f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +* Simplified ArchetypeResolve Initialization + ## v0.2.20 (2023-11-08) * Added unique option to register() * Added getResolvers() and getNormalizers() to Handler diff --git a/src/Handler.php b/src/Handler.php index 6d67683..9b4f935 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -409,7 +409,9 @@ protected function ensureResolver( string $interface ): void { if (!isset($this->resolvers[$interface])) { - if (!$class = $this->resolve(Resolver::class, $interface)) { + if ($interface === Resolver::class) { + $class = ArchetypeResolver::class; + } elseif (!$class = $this->resolve(Resolver::class, $interface)) { throw Exceptional::NotFound('Interface ' . $interface . ' has no Archetype resolver'); } @@ -422,6 +424,3 @@ protected function ensureResolver( // Register the Veneer facade Veneer::register(Handler::class, Archetype::class); - -// Load Archetype Resolver -Archetype::register(new ArchetypeResolver());