-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"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 { ... } ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can @Target
now be resolved, even though it's no longer imported "properly"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: