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\HttpClientInterface;
/**
@@ -33,13 +32,13 @@ class PostalCodeFRFromOpenData
$response = $this->client->request('GET', self::CSV);
if (200 !== $response->getStatusCode()) {
throw new RuntimeException('could not download CSV');
throw new \RuntimeException('could not download CSV');
}
$tmpfile = tmpfile();
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) {
@@ -59,7 +58,7 @@ class PostalCodeFRFromOpenData
$this->baseImporter->finalize();
fclose($tmpfile);
$this->logger->info(self::class . ' postal code fetched', ['offset' => $offset ?? 0]);
$this->logger->info(self::class.' postal code fetched', ['offset' => $offset ?? 0]);
}
private function handleRecord(array $record): void
@@ -74,7 +73,7 @@ class PostalCodeFRFromOpenData
if (str_starts_with($ref, '987')) {
// some differences in French Polynesia
$ref .= '.' . trim((string) $record['Libellé_d_acheminement']);
$ref .= '.'.trim((string) $record['Libellé_d_acheminement']);
}
$this->baseImporter->importCode(