Skip to content

Commit

Permalink
Merge branch 'main' into develop #3588
Browse files Browse the repository at this point in the history
  • Loading branch information
hmeneuvrier committed Jan 21, 2025
2 parents 2da42cf + 1edc71f commit d011d6f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Factory/SignalementExportFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ public function createInstanceFrom(User $user, array $data): SignalementExport
}

$infoProcedureBailMoyen = $infoProcedureBailMoyenLabel = null;
if (isset($data['informationProcedure']) && $data['informationProcedure'] instanceof InformationProcedure) {
if (isset($data['informationProcedure'])
&& $data['informationProcedure'] instanceof InformationProcedure
&& !empty($data['informationProcedure']->getInfoProcedureBailMoyen())) {
$infoProcedureBailMoyen = strtoupper($data['informationProcedure']->getInfoProcedureBailMoyen());
$infoProcedureBailMoyenLabel = MoyenContact::tryFrom($infoProcedureBailMoyen)?->label();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public function __invoke(SignalementAddressUpdateAndAutoAssignMessage $signaleme
try {
$signalement = $this->signalementRepository->find($signalementAddressUpdateAndAutoAssignMessage->getSignalementId());
$this->signalementAddressUpdater->updateAddressOccupantFromBanData($signalement);
$this->autoAssigner->assign($signalement);
$this->entityManager->flush();
$this->autoAssigner->assign($signalement);
} catch (\Throwable $exception) {
$this->logger->error(
sprintf(
Expand Down
8 changes: 8 additions & 0 deletions src/Specification/Affectation/CodeInseeSpecification.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,21 @@ private function isSignalementInZone(Signalement $signalement, Zone $zone): bool

private function isPointInPolygon(Coordinate $point, array $polygonData): bool
{
// special case : POLYGON ((X1 Y1, X2 Y2)))
if (1 === \count($polygonData)) {
$polygonData = $polygonData[0];
}
$polygon = $this->buildPolygon($polygonData);

return $polygon->contains($point);
}

private function isPointInMultiPolygon(Coordinate $point, array $multiPolygonData): bool
{
// special case : MULTIPOLYGON (((X1 Y1, X2 Y2),(X3 Y3, X4 Y4)))
if (1 === \count($multiPolygonData)) {
$multiPolygonData = $multiPolygonData[0];
}
foreach ($multiPolygonData as $polygonData) {
if ($this->isPointInPolygon($point, $polygonData)) {
return true;
Expand Down

0 comments on commit d011d6f

Please sign in to comment.