Releases: ray-di/Ray.Di
Releases · ray-di/Ray.Di
2.12.1
2.12.0
2.11.3
2.11.2
- Compatibility of Annotation classes with the PHP 8 attribute #235
In addition to this usage of annotating parameters directly ...
public function __construct(#[Named('checkout')] CreditCardProcessorInterface $processor)We also support annotating methods as we did before.
#[Named('checkout')]
public function __construct(CreditCardProcessorInterface $processor)For example, a library that supports both php7 and php8 can be written like this. In PHP 8, attribute loading is done at a faster execution speed.
/** @Named("checkout") */
#[Named('checkout')]
public function __construct(CreditCardProcessorInterface $processor)