apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -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'];
}