浏览代码

rector change

Vincent 2 年之前
父节点
当前提交
5830739a19

+ 2 - 2
src/Entity/Access/Access.php

@@ -432,7 +432,7 @@ class Access implements UserInterface, PasswordAuthenticatedUserInterface
         return $this;
     }
 
-    public function getRoles(): ?array
+    public function getRoles(): array
     {
         $roles = $this->roles;
         return array_unique($roles ?? []);
@@ -751,7 +751,7 @@ class Access implements UserInterface, PasswordAuthenticatedUserInterface
 
     #[Pure] public function getUserIdentifier(): string
     {
-        return $this->person->getUsername();
+        return $this->person->getUserIdentifier();
     }
 
     public function getPassword(): ?string

+ 1 - 1
src/EventSubscriber/ApiResourcesValidatorSubscriber.php

@@ -24,7 +24,7 @@ final class ApiResourcesValidatorSubscriber implements EventSubscriberInterface
      * ne se déclenche qu'après le post validate d'api platform
      * @return array[]
      */
-    public static function getSubscribedEvents()
+    public static function getSubscribedEvents(): array
     {
         return [
             KernelEvents::VIEW => ['validate', EventPriorities::POST_VALIDATE],

+ 2 - 2
src/Serializer/DefaultNormalizer.php

@@ -27,7 +27,7 @@ final class DefaultNormalizer implements NormalizerInterface, DenormalizerInterf
         }
     }
 
-    public function supportsNormalization($data, $format = null)
+    public function supportsNormalization($data, $format = null): bool
     {
         return $this->decorated->supportsNormalization($data, $format);
     }
@@ -38,7 +38,7 @@ final class DefaultNormalizer implements NormalizerInterface, DenormalizerInterf
         return $data;
     }
 
-    public function supportsDenormalization($data, $type, $format = null)
+    public function supportsDenormalization($data, $type, $format = null): bool
     {
         return $this->decorated->supportsDenormalization($data, $type, $format);
     }

+ 1 - 1
src/Service/Access/AdminAccessUtils.php

@@ -38,7 +38,7 @@ class AdminAccessUtils
         $adminAccess = new AdminAccess();
         $adminAccess
             ->setId($administrator->getId())
-            ->setUsername($administrator->getPerson()->getUsername())
+            ->setUsername($administrator->getPerson()->getUserIdentifier())
             ->setEmail($contactPoint->getEmail())
         ;
         return $adminAccess;

+ 4 - 7
src/Service/File/Storage/ApiLegacyStorage.php

@@ -20,14 +20,11 @@ class ApiLegacyStorage implements FileStorageInterface
     /**
      *  Si ces ids sont renseignés, on est en mode 'switch' et l'url de téléchargement est un peu différente
      */
-    private ?int $originalAccessId;
-    private ?int $asAccessId;
+    private ?int $originalAccessId = null;
+    private ?int $asAccessId = null;
 
-    public function __construct(
-        private ApiLegacyRequestService $apiLegacyRequestService
-    ) {
-        $this->originalAccessId = null;
-        $this->asAccessId = null;
+    public function __construct(private ApiLegacyRequestService $apiLegacyRequestService)
+    {
     }
 
     public function setSwitchAccount(int $originalAccessId, int $asAccessId) {

+ 1 - 1
src/Validator/Core/ContactPoint.php

@@ -10,7 +10,7 @@ class ContactPoint extends Constraint
 {
     public $message = '{{ type }}_non_unique';
 
-    public function getTargets()
+    public function getTargets(): string|array
     {
         return self::CLASS_CONSTRAINT;
     }

+ 1 - 1
src/Validator/Organization/OrganizationAddressPostal.php

@@ -10,7 +10,7 @@ class OrganizationAddressPostal extends Constraint
 {
     public $message = '{{ type }}_non_unique';
 
-    public function getTargets()
+    public function getTargets(): string|array
     {
         return self::CLASS_CONSTRAINT;
     }

+ 1 - 1
src/Validator/Organization/Parameters/MobytCredentials.php

@@ -10,7 +10,7 @@ class MobytCredentials extends Constraint
 {
     public $message = 'wrong_mobyt_credentials';
 
-    public function getTargets()
+    public function getTargets(): string|array
     {
         return self::CLASS_CONSTRAINT;
     }