-
-
Notifications
You must be signed in to change notification settings - Fork 737
Closed
rectorphp/rector-src
#3209Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | last dev-main |
| Installed as | composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.org/demo/4d56e655-adbd-4793-ad19-efdb46fdee80
<?php
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
final class SkipDoctrineCollection
{
/**
* @var Collection<int, Checkbox>
*/
private Collection $checkboxes;
public function __construct()
{
$this->checkboxes = new ArrayCollection();
}
public function getCheckboxes(): Collection
{
return $this->checkboxes;
}
}but there no changes if the property is public
See https://getrector.org/demo/a907458f-45dc-4467-b879-f9862575f1c3
<?php
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
final class SkipDoctrineCollection
{
/**
* @var Collection<int, Checkbox>
*/
public Collection $checkboxes;
public function __construct()
{
$this->checkboxes = new ArrayCollection();
}
public function getCheckboxes(): Collection
{
return $this->checkboxes;
}
}and no changes if there are 2 private Collections
See https://getrector.org/demo/460b439c-6dcc-4ec9-8c98-64f1c4e218f4
<?php
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
final class SkipDoctrineCollection
{
/**
* @var Collection<int, Checkbox>
*/
private Collection $checkboxes;
/**
* @var Collection<int, Radiobox>
*/
private Collection $radioboxes;
public function __construct()
{
$this->checkboxes = new ArrayCollection();
$this->radioboxes = new ArrayCollection();
}
public function getCheckboxes(): Collection
{
return $this->checkboxes;
}
public function getRadioboxes(): Collection
{
return $this->radioboxes;
}
}Responsible rules
RenamePropertyToMatchTypeRector
Expected Behavior
No changes