We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
vendor/bin/rector --version
Property is promoted to readonly while it's being mutated.
readonly
final class Retry { private $handler; public function __construct(callable $handler, private int $maxRetriesLeft) { $this->handler = $handler; } public function __invoke(): void { $this->retry(); } private function retry(): void { $this->maxRetriesLeft--; } }
1 file with changes =================== 1) app/Services/Clients/Middlewares/Retry.php:9 ---------- begin diff ---------- @@ @@ { private $handler; - public function __construct(callable $handler, private int $maxRetriesLeft) + public function __construct(callable $handler, private readonly int $maxRetriesLeft) { $this->handler = $handler; } ----------- end diff ----------- Applied rules: * ClassPropertyAssignToConstructorPromotionRector (https://wiki.php.net/rfc/constructor_promotion https://github.com/php/php-src/pull/5291) * ReadOnlyPropertyRector (https://wiki.php.net/rfc/readonly_properties_v2)
It shouldn't touch it. It's being used in a function
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Bug Report
vendor/bin/rector --version
)Property is promoted to
readonly
while it's being mutated.Minimal PHP Code Causing Issue
Expected Behaviour
It shouldn't touch it. It's being used in a function
The text was updated successfully, but these errors were encountered: