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:
@@ -11,12 +11,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Service\Import;
|
||||
|
||||
use Exception;
|
||||
use League\Csv\Reader;
|
||||
use League\Csv\Statement;
|
||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||
use UnexpectedValueException;
|
||||
use function is_int;
|
||||
|
||||
class AddressReferenceFromBano
|
||||
{
|
||||
@@ -24,8 +21,8 @@ class AddressReferenceFromBano
|
||||
|
||||
public function import(string $departementNo): void
|
||||
{
|
||||
if (!is_numeric($departementNo) || !is_int((int) $departementNo)) {
|
||||
throw new UnexpectedValueException('Could not parse this department number');
|
||||
if (!is_numeric($departementNo) || !\is_int((int) $departementNo)) {
|
||||
throw new \UnexpectedValueException('Could not parse this department number');
|
||||
}
|
||||
|
||||
$url = "https://bano.openstreetmap.fr/data/bano-{$departementNo}.csv";
|
||||
@@ -33,7 +30,7 @@ class AddressReferenceFromBano
|
||||
$response = $this->client->request('GET', $url);
|
||||
|
||||
if (200 !== $response->getStatusCode()) {
|
||||
throw new Exception('Could not download CSV: ' . $response->getStatusCode());
|
||||
throw new \Exception('Could not download CSV: '.$response->getStatusCode());
|
||||
}
|
||||
|
||||
$file = tmpfile();
|
||||
@@ -65,7 +62,7 @@ class AddressReferenceFromBano
|
||||
$record['postcode'],
|
||||
$record['street'],
|
||||
$record['streetNumber'],
|
||||
'BANO.' . $departementNo,
|
||||
'BANO.'.$departementNo,
|
||||
(float) $record['lat'],
|
||||
(float) $record['lon'],
|
||||
4326
|
||||
|
Reference in New Issue
Block a user