Browse Source

merge request fix

Vincent GUFFON 3 years ago
parent
commit
d521bb6146

+ 1 - 1
composer.json

@@ -54,7 +54,7 @@
     },
     "require-dev": {
         "cyclonedx/cyclonedx-php-composer": "^3.4",
-        "rector/rector": "^0.12.23",
+        "rector/rector": "^0.12.*",
         "symfony/debug-bundle": "5.4.*",
         "symfony/maker-bundle": "^1.21",
         "symfony/phpunit-bridge": "^5.4",

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

@@ -431,7 +431,7 @@ class Access implements UserInterface
     public function getRoles(): ?array
     {
         $roles = $this->roles;
-        return $roles ? array_unique($roles) : [];
+        return array_unique($roles ?? []);
     }
 
     public function getPersonActivity(): Collection

+ 3 - 3
src/Message/Handler/Parameters/AverageChangeHandler.php

@@ -6,7 +6,7 @@ namespace App\Message\Handler\Parameters;
 use App\Message\Command\Parameters\AverageChange;
 use App\Repository\Education\EducationNotationRepository;
 use App\Repository\Organization\ParametersRepository;
-use App\Service\Elasticsearch\EducationNotationUpdate;
+use App\Service\Elasticsearch\EducationNotationUpdater;
 use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
 
 /**
@@ -15,7 +15,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
 class AverageChangeHandler implements MessageHandlerInterface
 {
     public function __construct(
-        private EducationNotationUpdate $educationNotationUpdate,
+        private EducationNotationUpdater $educationNotationUpdater,
         private EducationNotationRepository $educationNotationRepository,
         private ParametersRepository $parametersRepository
     ) {}
@@ -29,7 +29,7 @@ class AverageChangeHandler implements MessageHandlerInterface
         $parameter = $this->parametersRepository->find($averageChange->getParametersId());
         if($parameter){
             $educationNotations = $this->educationNotationRepository->findAllEducationNotation($parameter->getOrganization());
-            $this->educationNotationUpdate->update($educationNotations);
+            $this->educationNotationUpdater->update($educationNotations);
         }
     }
 }

+ 2 - 2
src/Service/Elasticsearch/EducationNotationUpdate.php → src/Service/Elasticsearch/EducationNotationUpdater.php

@@ -6,9 +6,9 @@ namespace App\Service\Elasticsearch;
 use FOS\ElasticaBundle\Persister\ObjectPersister;
 
 /**
- * Classe EducationNotationUpdate qui s'occupe de la mise à jour ES pour EducationNotation
+ * Classe EducationNotationUpdater qui s'occupe de la mise à jour ES pour EducationNotation
  */
-class EducationNotationUpdate
+class EducationNotationUpdater
 {
     public function __construct(private ObjectPersister $objectPersisterOrganization)
     {