mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-11-09 13:48:23 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -11,10 +11,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Service\Import;
|
||||
|
||||
use Exception;
|
||||
use League\Csv\Reader;
|
||||
use League\Csv\Statement;
|
||||
use RuntimeException;
|
||||
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
|
||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||
|
||||
@@ -37,10 +35,10 @@ class AddressReferenceBEFromBestAddress
|
||||
$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);
|
||||
}
|
||||
|
||||
$asset = array_filter($release['assets'], static fn (array $item) => 'addresses-' . $list . '.' . $lang . '.csv.gz' === $item['name']);
|
||||
$asset = array_filter($release['assets'], static fn (array $item) => 'addresses-'.$list.'.'.$lang.'.csv.gz' === $item['name']);
|
||||
|
||||
return array_values($asset)[0]['browser_download_url'];
|
||||
}
|
||||
@@ -52,10 +50,10 @@ class AddressReferenceBEFromBestAddress
|
||||
$response = $this->client->request('GET', $downloadUrl);
|
||||
|
||||
if (200 !== $response->getStatusCode()) {
|
||||
throw new Exception('Could not download CSV: ' . $response->getStatusCode());
|
||||
throw new \Exception('Could not download CSV: '.$response->getStatusCode());
|
||||
}
|
||||
|
||||
$tmpname = tempnam(sys_get_temp_dir(), 'php-add-' . $list . $lang);
|
||||
$tmpname = tempnam(sys_get_temp_dir(), 'php-add-'.$list.$lang);
|
||||
$file = fopen($tmpname, 'r+b');
|
||||
|
||||
foreach ($this->client->stream($response) as $chunk) {
|
||||
@@ -79,8 +77,8 @@ class AddressReferenceBEFromBestAddress
|
||||
$record['municipality_objectid'],
|
||||
$record['postal_info_objectid'],
|
||||
$record['streetname'],
|
||||
$record['housenumber'] .($record['boxnumber'] !== '' ? ' bte '. $record['boxnumber'] : ''),
|
||||
'bestaddress.' . $list,
|
||||
$record['housenumber'].('' !== $record['boxnumber'] ? ' bte '.$record['boxnumber'] : ''),
|
||||
'bestaddress.'.$list,
|
||||
(float) $record['Y'],
|
||||
(float) $record['X'],
|
||||
3812
|
||||
|
||||
Reference in New Issue
Block a user