-
-
Notifications
You must be signed in to change notification settings - Fork 742
Closed
rectorphp/rector-src
#7834Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | e.g. v1.0.0 (invoke vendor/bin/rector --version) |
https://www.php.net/releases/8.5/en.php#closures-in-const-expr
The following code:
class SomeHandler
{
#[Idempotency(key: static function(Command $command) : IdempotencyKey {
return new IdempotencyKey(
'key',
);
}, seconds: 604_800)]
public function __invoke(Command $command) : void
{}
}Is changed by ClosureToArrowFunctionRector:
---------- begin diff ----------
#[AsCommandHandler]
- #[Idempotency(key: static function(Command $command) : IdempotencyKey { return new IdempotencyKey(
+ #[Idempotency(key: static fn(Command $command): IdempotencyKey => new IdempotencyKey(
'key',
- );}, seconds: 604_800)]
+ ), seconds: 604_800)]
public function __invoke(Command $command) : void
{
----------- end diff -----------
Applied rules:
* ClosureToArrowFunctionRector
But this is not allowed. fn is not allowed inside attributes.
Reactions are currently unavailable