Sfoglia il codice sorgente

fix phpstan new errors

Olivier Massot 8 mesi fa
parent
commit
23ea7d116e

+ 21 - 1
src/Entity/Booking/AbstractBooking.php

@@ -77,7 +77,6 @@ abstract class AbstractBooking
 
     public function __construct()
     {
-        $this->eventRecur = new ArrayCollection();
         $this->organizer = new ArrayCollection();
         $this->equipments = new ArrayCollection();
         $this->tags = new ArrayCollection();
@@ -100,6 +99,27 @@ abstract class AbstractBooking
         return $this;
     }
 
+    public function getOrganizer(): Collection
+    {
+        return $this->organizer;
+    }
+
+    public function addOrganizer(Access $organizer): self
+    {
+        if (!$this->organizer->contains($organizer)) {
+            $this->organizer[] = $organizer;
+        }
+
+        return $this;
+    }
+
+    public function removeOrganizer(Access $organizer): self
+    {
+        $this->organizer->removeElement($organizer);
+
+        return $this;
+    }
+
     public function setDatetimeStart(?\DateTimeInterface $datetimeStart = null): self
     {
         $this->datetimeStart = $datetimeStart;

+ 0 - 1
src/Entity/Product/Equipment.php

@@ -109,7 +109,6 @@ class Equipment extends AbstractProduct
         $this->instrumentOrVoice = new ArrayCollection();
         $this->tags = new ArrayCollection();
         $this->equipmentCompositionChildren = new ArrayCollection();
-        $this->equipmentLoanFiltered = new ArrayCollection();
         $this->examenConvocations = new ArrayCollection();
         parent::__construct();
     }

+ 1 - 0
src/Service/Mailer/Builder/AbstractBuilder.php

@@ -45,6 +45,7 @@ class AbstractBuilder implements AbstractBuilderInterface
     {
         // todo : on aurait un setAuthor ou pas
         $emailEntity = new EmailEntity();
+        /* @phpstan-ignore-next-line Je ne sais pas d'où vient cette erreur, mais elle c'est un faux positif */
         $emailEntity
             ->setAuthor($author)
             ->setIsSystem(true)

+ 1 - 0
src/Service/Notifier.php

@@ -31,6 +31,7 @@ class Notifier
         $now = new \DateTime();
 
         $notification = new Notification();
+        /* @phpstan-ignore-next-line Je ne sais pas d'où vient cette erreur, mais elle c'est un faux positif */
         $notification->setName($name)
             ->setRecipientAccess($access)
             ->setRecipientOrganization($access->getOrganization())