Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrige la duplication d'un arreté #1025

Merged
merged 1 commit into from
Oct 23, 2024
Merged

Conversation

@mmarchois mmarchois force-pushed the fix/duplicate-regulation-order branch from 753d7f9 to aa31d2d Compare October 22, 2024 15:42
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.00%. Comparing base (912f61c) to head (aa31d2d).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1025   +/-   ##
=========================================
  Coverage     99.00%   99.00%           
  Complexity     1666     1666           
=========================================
  Files           326      326           
  Lines          7212     7212           
=========================================
  Hits           7140     7140           
  Misses           72       72           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@florimondmanca florimondmanca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'approuve pour ne pas bloquer mais une suggestion si jamais elle fait sens

@@ -55,8 +55,8 @@ private function duplicateRegulationOrderRecord(
$generalInfo->description = $originalRegulationOrder->getDescription();
$generalInfo->startDate = $originalRegulationOrder->getStartDate();
$generalInfo->endDate = $originalRegulationOrder->getEndDate();
$generalInfo->additionalVisas = $originalRegulationOrder->getAdditionalVisas();
$generalInfo->additionalReasons = $originalRegulationOrder->getAdditionalReasons();
$generalInfo->additionalVisas = $originalRegulationOrder->getAdditionalVisas() ?? [];
Copy link
Collaborator

@florimondmanca florimondmanca Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ça corrige mais je me demandais si ça faisait sens de mettre ce ?? [] directement dans getAdditionalVisas() et getAdditionalReasons() ?

Car en réalité on ne veut jamais manipuler null sur ces arrays, c'est une source d'erreur, il faut un array quitte à ce qu'il soit vide

Or en l'état on devrait se rappeler d'utiliser ?? [] chaque fois qu'on appelle un de ces deux getters

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disons que nous l'avons déjà fait à différents endroits. Je ne suis absolument pas contre le fait de faire évoluer les getters devant retourner des tableaux.
Je pense faire une PR à part pour avoir une refacto plus large. Mais je partage ton avis !

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK !

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mmarchois mmarchois merged commit c58f06b into main Oct 23, 2024
6 checks passed
@mmarchois mmarchois deleted the fix/duplicate-regulation-order branch October 23, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants