Quellcode durchsuchen

updates post MR review

Olivier Massot vor 3 Jahren
Ursprung
Commit
906eaa35b5

+ 1 - 0
config/packages/messenger.yaml

@@ -11,6 +11,7 @@ framework:
 
         routing:
             # Route your messages to the transports
+            'App\Message\Command\Parameters\AverageChange': async
             'App\Message\Command\Export': async
             'App\Message\Command\Typo3\Typo3UpdateCommand': async
             'App\Message\Command\Typo3\Typo3DeleteCommand': async

+ 2 - 3
src/Entity/Traits/ActivityYearTrait.php

@@ -18,9 +18,8 @@ trait ActivityYearTrait
         return $this->startYear;
     }
 
-    public function setStartYear(?int $startYear = null):self {
-        if($startYear == null) $startYear = intval(date('Y'));
-        $this->startYear = $startYear;
+    public function setStartYear(?int $startYear = null): self {
+        $this->startYear = $startYear ?? (int)(date('Y'));
         return $this;
     }
 

+ 2 - 0
src/Service/Access/Utils.php

@@ -17,6 +17,8 @@ use Symfony\Component\Security\Core\Role\RoleHierarchyInterface;
  */
 class Utils
 {
+    // TODO: Renommer en AccessUtils
+
     public function __construct(
         private RoleHierarchyInterface $roleHierarchy,
         private AccessRepository $accessRepository,

+ 2 - 0
src/Service/Cotisation/Utils.php

@@ -17,6 +17,8 @@ use App\Service\Network\Utils as NetworkUtils;
  */
 class Utils
 {
+    // TODO: Renommer en CotisationUtils
+
     const MEMBERSHIP_WAITING = 495; // Affiliation in progress
     const MEMBERSHIP_NOPAYMENT = 517; // Waiting paiement
     const SUBMIT_IN_PROGRESS = 540; // Affiliation in progress

+ 1 - 3
src/Service/Network/Utils.php

@@ -15,9 +15,7 @@ use App\Tests\Service\Network\UtilsTest;
  */
 class Utils
 {
-    // TODO: question - est-ce qu'on ne passerait pas toutes ces méthodes en static?
-    // TODO: question - est-ce qu'on ne ferait pas mieux de renommer les différentes classes Utils avec des noms
-    //                  différents? comme NetworkUtils ou OrganizationUtils? pour éviter les confusions?
+    // TODO: Renommer en NetworkUtils
     /**
      * Test si l'organisation appartient au réseau de la CMF
      * @param Organization $organization

+ 2 - 0
src/Service/Organization/Utils.php

@@ -16,6 +16,8 @@ use Doctrine\Common\Collections\Criteria;
  */
 class Utils
 {
+    // TODO: Renommer en OrganizationUtils
+
     const START_DATE_KEY = 'dateStart';
     const END_DATE_KEY = 'dateEnd';