Skip to content

Commit

Permalink
remove html desordres precsions #2023
Browse files Browse the repository at this point in the history
  • Loading branch information
sfinx13 committed Mar 7, 2024
1 parent 53bea91 commit 3e0b107
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Factory/Interconnection/Oilhi/DossierMessageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use App\Entity\Situation;
use App\Factory\Interconnection\DossierMessageFactoryInterface;
use App\Messenger\Message\Oilhi\DossierMessage;
use App\Service\HtmlCleaner;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
Expand Down Expand Up @@ -146,18 +147,17 @@ private function buildDesordresData(Signalement $signalement): array
}

if (!$signalement->getDesordrePrecisions()->isEmpty()) {
$precisions = implode(
', ',
$signalement
->getDesordrePrecisions()
->filter(function (DesordrePrecision $desordrePrecision) {
return ' - ' !== $desordrePrecision->getLabel();
})
->map(function (DesordrePrecision $desordrePrecision) {
return $desordrePrecision->getLabel();
})->toArray()
);
$desordres['precisions'] = str_replace('-', '', $precisions);
$precisionsList = $signalement
->getDesordrePrecisions()
->filter(function (DesordrePrecision $desordrePrecision) {
return ' - ' !== $desordrePrecision->getLabel();
})
->map(function (DesordrePrecision $desordrePrecision) {
if (!empty($desordrePrecision->getLabel())) {
return HtmlCleaner::clean($desordrePrecision->getLabel());
}
})->toArray();
$desordres['precisions'] = implode(',', array_filter($precisionsList));
}

return $desordres;
Expand Down

0 comments on commit 3e0b107

Please sign in to comment.