fix: monter PHPStan à niveau 8 — corriger 2 bugs file_get_contents/json_encode

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gwadaking
2026-04-03 17:08:45 -04:00
parent 0d323b871b
commit 00996cb163
3 changed files with 7 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
parameters: parameters:
level: 6 level: 8
paths: paths:
- src - src
symfony: symfony:

View File

@@ -188,7 +188,11 @@ class IngestionService
return null; return null;
} }
$data = json_decode(file_get_contents($geojsonPath), true); $contents = file_get_contents($geojsonPath);
if ($contents === false) {
return null;
}
$data = json_decode($contents, true);
if (empty($data['features'])) { if (empty($data['features'])) {
return null; return null;

View File

@@ -45,7 +45,7 @@ class PushNotificationService
'body' => sprintf('Score %d/100 — %s. Vérifiez avant de partir.', $score, ucfirst($level)), 'body' => sprintf('Score %d/100 — %s. Vérifiez avant de partir.', $score, ucfirst($level)),
'url' => $this->appPublicUrl, 'url' => $this->appPublicUrl,
'spotId' => (string) $spot->getId(), 'spotId' => (string) $spot->getId(),
]); ]) ?: null;
$expired = []; $expired = [];