"defer" annotation as PHP 8 attribute#57
Conversation
This changes the implementation of the @defer annotation so that it can also be used as a PHP 8 attribute. The annotation is backwards compatible and can still be used in the previous way as part of a doc comment. Example: ```php #[Defer(queueName: "MyJobQueue")] public function handle(SomeCommand $command): void { ... } ```
kdambekalns
left a comment
There was a problem hiding this comment.
Looks good… I wonder if we could adjust the dependencies to this along the way:
"php": "^7.4 || ^8.0",
"neos/flow": "^6.3 || ^7.0 || ^8.0 || dev-master",| * @Annotation | ||
| * @DoctrineAnnotation\Target("METHOD") | ||
| * @NamedArgumentConstructor | ||
| * @Target("METHOD") |
There was a problem hiding this comment.
Why can @Target now be resolved, even though it's no longer imported "properly"?
There was a problem hiding this comment.
To be honest – I also wondered about it.But the Flow @around annotation does the same and @Annotation doesn't have to be imported, either. It seems to work. 🤷🏻
|
Ah … but the type declarations are a breaking change, because they require at least PHP 7.4 (not 7.1, which is currently declared in composer.json). So what do we do about that? Raise the requirement? Please? |
Yes, as I already suggested… |
Ah 🤦🏻 |
|
@kdambekalns here we go: #58 |
This changes the implementation of the @defer annotation so that it
can also be used as a PHP 8 attribute. The annotation is backwards
compatible and can still be used in the previous way as part of a
doc comment.
Example: