Missing behaviour of `DoctrineSetList::DOCTRINE_CODE_QUALITY`
Bug Report
| Subject | Details |
|---|---|
| Rector version | 0.13.7 |
| Installed as | composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.org/demo/5bc8005e-3298-4f48-9f81-fb97526e0ff2
<?php
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\JoinColumn;
#[Entity]
class Entity
{
#[JoinColumn(nullable: true)]
private ?Reference $reference;
}
Responsible rules
-
MoveCurrentDateTimeDefaultInEntityToConstructorRector -
RemoveRedundantDefaultClassAnnotationValuesRector -
RemoveRedundantDefaultPropertyAnnotationValuesRector
Expected Behavior
rector successfully removes the nullable: true in #[JoinColumn] (since it's already default). But now the whole #[JoinColumn] isn't needed anymore and should be removed, shouldn't it?
/cc @OskarStark
This behavior is out of scope of defined rules. They only remove default values, not classes without effect.
A new rule is needed to handle your case.
Closing as answered.
@mvhirsch if you like you can create this rule in the working time 👍🏻😃
That would be great :clap: :slightly_smiling_face: