1.16.0
Parameter-level Attributes for Ray.Di 2.19.1
Summary
This release migrates Ray.AuraSqlModule to use parameter-level attributes for dependency injection, ensuring compatibility with Ray.Di 2.19.1.
Breaking Changes
Ray.Di 2.19.0 removed method-level attribute support for qualified parameters. This release migrates all qualifier attributes to parameter-level, aligning with PHP 8's native attribute targeting.
Changes
Attribute Definitions
Updated qualifier attributes to target parameters instead of methods:
AuraSqlQueryConfig:TARGET_METHOD→TARGET_PARAMETEREnvAuth:TARGET_METHOD→TARGET_PARAMETERPagerViewOption:TARGET_PARAMETER, made$valueoptional- Test fixtures updated accordingly
Module Configuration
Enhanced Validation
- NamedPdoModule now validates non-empty qualifiers in constructor
- Throws
InvalidArgumentExceptionwith clear error message - Directs users to
AuraSqlModulefor unqualified bindings - Simplified internal logic
- Throws
Array Format for toConstructor
Migrated from legacy string format to array format:
// Before
'dsn=pdo_dsn,username=pdo_user'
// After
['dsn' => 'pdo_dsn', 'username' => 'pdo_user']Bug Fixes
- Fixed
NamedPdoModuleto properly pass$optionsand$queriesparameters to ExtendedPdo - Added missing
driver_optionsandafter_connectparameter bindings
Code Quality Improvements
- Eliminated conditional binding anti-patterns via method splitting
- Separate methods for qualified/unqualified configuration paths
- Improved PHPStan compatibility with type-safe qualifier handling
- Better code maintainability and readability
Testing
- Added test coverage for empty qualifier validation
- All 76 tests passing with 145 assertions
- PHPStan, PHPCS, and Psalm checks passing
Cleanup
- Removed deprecated
ServiceLocatorsetup from tests - Removed coverage configuration from
phpunit.xml.dist - Coverage now generated only when explicitly requested
Migration Guide
If you're using Ray.Di < 2.19.1, update your dependencies:
composer require ray/di:^2.19.1 ray/aop:^2.19No code changes required in your application - the attribute migration is internal to the module.
Related
- Depends on ray-di/Ray.Di#306 (Ray.Di 2.19.1)
- Part of Ray.MediaQuery 1.0 preparation