Skip to content

Add PSR-11 container interface methods to TracingResolver - #11

Merged
robertvansteen merged 2 commits into
mainfrom
claude/add-psr11-support-zhqql
Mar 27, 2026
Merged

robertvansteen merged 2 commits into
mainfrom
claude/add-psr11-support-zhqql

Conversation

@robertvansteen

Copy link
Copy Markdown
Contributor

Summary

This PR adds support for PSR-11 container interface methods (get() and has()) to the TracingResolver class, enabling it to be used as a drop-in replacement for any PSR-11 compatible container.

Changes

  • Added get(string $id): mixed method - Delegates to the inner resolver's get() method to retrieve a service by its identifier
  • Added has(string $id): bool method - Delegates to the inner resolver's has() method to check if a service is registered
  • Added comprehensive test coverage - New tests verify that both methods properly delegate to the inner resolver and return expected results
  • Updated dependencies - Added psr/container: ^2.0 as an explicit dependency to support the PSR-11 interface

Implementation Details

Both methods are simple delegation methods that pass through to the inner resolver without any tracing overhead, maintaining the existing pattern used by other delegation methods in the class. This allows the TracingResolver to maintain full compatibility with the PSR-11 ContainerInterface while preserving its tracing capabilities for resolution operations.

https://claude.ai/code/session_012JM3NBW2w7F9vhGSmrMWuf

claude added 2 commits March 27, 2026 09:20
The upstream axiom package now has BindableResolver extending
PSR-11's ContainerInterface. This adds the required get() and has()
methods to TracingResolver, delegating to the inner resolver.

https://claude.ai/code/session_012JM3NBW2w7F9vhGSmrMWuf
@robertvansteen
robertvansteen merged commit d87f768 into main Mar 27, 2026
1 check passed
@robertvansteen
robertvansteen deleted the claude/add-psr11-support-zhqql branch March 27, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants