Download the PHP package bermudaphp/di-resolver without Composer
On this page you can find all versions of the php package bermudaphp/di-resolver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bermudaphp/di-resolver
More information about bermudaphp/di-resolver
Files in bermudaphp/di-resolver
Package di-resolver
Short Description A powerful and flexible parameter resolution library for PHP that automatically resolves function and method parameters from various sources
License MIT
Informations about the package di-resolver
Parameter Resolver
🇷🇺 Русская версия
A powerful and flexible parameter resolution library for PHP that automatically resolves function and method parameters from various sources including arrays, DI containers, and configuration.
Features
- Multiple Resolution Strategies: Resolve parameters by name, position, type, or attributes
- DI Container Integration: Seamless integration with PSR-11 containers
- Attribute Support: Native PHP 8+ attributes (
#[Config],#[Inject]) - Union Types: Full support for PHP 8 union types
- Extensible Architecture: Easy to add custom resolvers
- Zero Dependencies: Core functionality requires no external dependencies
- High Performance: Optimized resolver chain with early termination
Installation
Quick Start
Core Resolvers
ArrayResolver
Resolves parameters by name or position from provided array:
ArrayTypedResolver
Resolves parameters by object type scanning:
ContainerResolver
Resolves from PSR-11 DI containers with attribute support:
DefaultValueResolver
Uses parameter default values:
NullableResolver
Resolves nullable parameters to null:
DI Container Integration
Full Integration Example
Configuration Management
The Config attribute supports dot notation and various data sources:
ArrayAccess Support
Advanced Usage
Custom Resolvers
Union Type Support
Resolver Priorities
Error Handling
Performance Tips
- Order resolvers by frequency - put most commonly used resolvers first
- Use typed parameters when possible for faster ArrayTypedResolver matching
- Avoid deep nesting in Config paths for better performance
- Cache reflection objects when resolving the same signatures repeatedly
Requirements
- PHP 8.4 or higher
License
MIT License. See LICENSE for details.
All versions of di-resolver with dependencies
psr/container Version ^2.0
bermudaphp/reflection Version ^2.0
bermudaphp/reflection-type-matcher Version ^1.1
bermudaphp/types Version ^1.0
bermudaphp/config Version ^2.0