Skip to content

2.11.2

Choose a tag to compare

@koriym koriym released this 17 Jan 17:53
· 558 commits to 2.x since this release
9ef49de
  • 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)