diff --git a/Cache/Navitia.php b/Cache/Navitia.php index 1a38f34..98a80cf 100644 --- a/Cache/Navitia.php +++ b/Cache/Navitia.php @@ -89,6 +89,7 @@ private function checkPublicationDate(): void if ($cacheItem->isHit()) { $publicationDateInCache = $cacheItem->get(); } + $currentPublicationDate = $this->getPublicationDate(); if ($currentPublicationDate !== null && $currentPublicationDate !== $publicationDateInCache) { @@ -127,7 +128,7 @@ public function setCacheItem(string $cacheKey, $data): void $this->cache->save($cacheItem); } - private function getPublicationDate(): string + private function getPublicationDate(): ?string { try { $url = $this->urlApi.'coverage/'.$this->coverage.'/'.self::PUBLICATION_DATE_API;