Skip to content

Commit

Permalink
Merge branch 'release/v0.2.21'
Browse files Browse the repository at this point in the history
  • Loading branch information
betterthanclay committed Nov 9, 2023
2 parents dd81b70 + c31fdae commit b90c14e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v0.2.21 (2023-11-09)
* Simplified ArchetypeResolver Initialization

## v0.2.20 (2023-11-08)
* Added unique option to register()
* Added getResolvers() and getNormalizers() to Handler
Expand Down
7 changes: 3 additions & 4 deletions src/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand All @@ -422,6 +424,3 @@ protected function ensureResolver(

// Register the Veneer facade
Veneer::register(Handler::class, Archetype::class);

// Load Archetype Resolver
Archetype::register(new ArchetypeResolver());

0 comments on commit b90c14e

Please sign in to comment.