DX: fix phpstan issues

This commit is contained in:
2023-03-28 22:32:08 +02:00
parent 331443ae12
commit 48772efd54
27 changed files with 76 additions and 1309 deletions

View File

@@ -66,22 +66,6 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface
$manager->flush();
}
private function createAddress(): ObjectSet
{
$loader = new NativeLoader();
return $loader->loadData([
Address::class => [
'address1' => [
'name' => '<fr_FR:company()>',
'telephone' => $this->phoneNumberUtil->getExampleNumber('FR'),
'email' => '<email()>',
'comment' => '<fr_FR:realTextBetween(10, 500)>',
],
],
]);
}
private function getCenters(): Iterator
{
$references = array_map(

View File

@@ -23,6 +23,7 @@ use DateTimeImmutable;
use DateTimeInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ReadableCollection;
use Doctrine\ORM\Mapping as ORM;
use libphonenumber\PhoneNumber;
use Symfony\Component\Serializer\Annotation\Context;
@@ -153,7 +154,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
* @ORM\OneToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty", mappedBy="parent",
* cascade={"persist"}, orphanRemoval=true)
*
* @var Collection|ThirdParty[]
* @var Collection<(int|string), ThirdParty>
* @Assert\Valid(traverse=true)
*/
private Collection $children;
@@ -400,7 +401,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
/**
* Get the children where active = true.
*/
public function getActiveChildren(): Collection
public function getActiveChildren(): ReadableCollection
{
return $this->children->filter(static fn (ThirdParty $tp) => $tp->getActive());
}