-
-
Notifications
You must be signed in to change notification settings - Fork 737
Closed
rectorphp/rector-src
#6979Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | last dev-main |
| Installed as | composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.com/demo/6fae90ed-2fb2-489d-a1db-ea260aa06132
<?php
use JMS\Serializer\Annotation as JMS;
/**
* This is a DTO for a third-party-published message, consumed by Symfony.
**/
class AsyncMessage
{
#[JMS\Type('string')]
private string $value;
public function getValue(): string
{
return $this->value;
}
}Responsible rules
ReadOnlyPropertyRector
Expected Behavior
JMS properties should not be marked as readonly.
As other whitelisted annotations in src/NodeManipulator/PropertyManipulator.php::ALLOWED_NOT_READONLY_CLASS_ANNOTATIONS exist, if the class or property uses any of the JMS\Serializer\Annotation\* annotations, the rector should refrain from adding the readonly flag.