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

@@ -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