diff --git a/backend/phpstan.neon b/backend/phpstan.neon index d33a641..699f928 100644 --- a/backend/phpstan.neon +++ b/backend/phpstan.neon @@ -1,5 +1,5 @@ parameters: - level: 6 + level: 8 paths: - src symfony: diff --git a/backend/src/Service/Ingestion/IngestionService.php b/backend/src/Service/Ingestion/IngestionService.php index f700e62..4bc5667 100644 --- a/backend/src/Service/Ingestion/IngestionService.php +++ b/backend/src/Service/Ingestion/IngestionService.php @@ -188,7 +188,11 @@ class IngestionService 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'])) { return null; diff --git a/backend/src/Service/Push/PushNotificationService.php b/backend/src/Service/Push/PushNotificationService.php index 92f18f3..d284cee 100644 --- a/backend/src/Service/Push/PushNotificationService.php +++ b/backend/src/Service/Push/PushNotificationService.php @@ -45,7 +45,7 @@ class PushNotificationService 'body' => sprintf('Score %d/100 — %s. Vérifiez avant de partir.', $score, ucfirst($level)), 'url' => $this->appPublicUrl, 'spotId' => (string) $spot->getId(), - ]); + ]) ?: null; $expired = [];