mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 11:33:49 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -13,7 +13,6 @@ namespace Chill\MainBundle\Service\Import;
|
||||
|
||||
use League\Csv\Reader;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use RuntimeException;
|
||||
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
|
||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||
|
||||
@@ -33,7 +32,7 @@ class PostalCodeBEFromBestAddress
|
||||
$tmpfile = fopen($tmpname, 'r+b');
|
||||
|
||||
if (false === $tmpfile) {
|
||||
throw new RuntimeException('could not create temporary file');
|
||||
throw new \RuntimeException('could not create temporary file');
|
||||
}
|
||||
|
||||
foreach ($this->client->stream($response) as $chunk) {
|
||||
@@ -55,11 +54,11 @@ class PostalCodeBEFromBestAddress
|
||||
gzclose($uncompressedStream);
|
||||
unlink($tmpname);
|
||||
|
||||
$this->logger->info(self::class . ' list of postal code downloaded');
|
||||
$this->logger->info(self::class.' list of postal code downloaded');
|
||||
|
||||
$this->baseImporter->finalize();
|
||||
|
||||
$this->logger->info(self::class . ' postal code fetched', ['offset' => $offset ?? 0]);
|
||||
$this->logger->info(self::class.' postal code fetched', ['offset' => $offset ?? 0]);
|
||||
}
|
||||
|
||||
private function getFileDownloadUrl(string $lang): string
|
||||
@@ -68,10 +67,10 @@ class PostalCodeBEFromBestAddress
|
||||
$release = $this->client->request('GET', self::RELEASE)
|
||||
->toArray();
|
||||
} catch (TransportExceptionInterface $e) {
|
||||
throw new RuntimeException('could not get the release definition', 0, $e);
|
||||
throw new \RuntimeException('could not get the release definition', 0, $e);
|
||||
}
|
||||
|
||||
$postals = array_filter($release['assets'], static fn (array $item) => 'postals.' . $lang . '.csv.gz' === $item['name']);
|
||||
$postals = array_filter($release['assets'], static fn (array $item) => 'postals.'.$lang.'.csv.gz' === $item['name']);
|
||||
|
||||
return array_values($postals)[0]['browser_download_url'];
|
||||
}
|
||||
|
Reference in New Issue
Block a user