mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-07 15:25:00 +00:00
apply rules rector up to php82
This commit is contained in:
@@ -22,7 +22,7 @@ class AddressReferenceBEFromBestAddress
|
||||
{
|
||||
private const RELEASE = 'https://gitea.champs-libres.be/api/v1/repos/Chill-project/belgian-bestaddresses-transform/releases/tags/v1.0.0';
|
||||
|
||||
public function __construct(private HttpClientInterface $client, private AddressReferenceBaseImporter $baseImporter, private AddressToReferenceMatcher $addressToReferenceMatcher)
|
||||
public function __construct(private readonly HttpClientInterface $client, private readonly AddressReferenceBaseImporter $baseImporter, private readonly AddressToReferenceMatcher $addressToReferenceMatcher)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -50,7 +50,7 @@ final class AddressReferenceBaseImporter
|
||||
|
||||
private array $waitingForInsert = [];
|
||||
|
||||
public function __construct(private Connection $defaultConnection, private LoggerInterface $logger)
|
||||
public function __construct(private readonly Connection $defaultConnection, private readonly LoggerInterface $logger)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ use function is_int;
|
||||
|
||||
class AddressReferenceFromBano
|
||||
{
|
||||
public function __construct(private HttpClientInterface $client, private AddressReferenceBaseImporter $baseImporter, private AddressToReferenceMatcher $addressToReferenceMatcher)
|
||||
public function __construct(private readonly HttpClientInterface $client, private readonly AddressReferenceBaseImporter $baseImporter, private readonly AddressToReferenceMatcher $addressToReferenceMatcher)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -19,7 +19,7 @@ use Psr\Log\LoggerInterface;
|
||||
* Mark existing addresses as to be reviewed regarding the
|
||||
* address reference
|
||||
*/
|
||||
final class AddressToReferenceMatcher
|
||||
final readonly class AddressToReferenceMatcher
|
||||
{
|
||||
private const LOG_PREFIX = '[address_to_reference_matcher] ';
|
||||
|
||||
|
@@ -47,7 +47,7 @@ final class GeographicalUnitBaseImporter
|
||||
|
||||
private array $waitingForInsert = [];
|
||||
|
||||
public function __construct(private Connection $defaultConnection, private LoggerInterface $logger)
|
||||
public function __construct(private readonly Connection $defaultConnection, private readonly LoggerInterface $logger)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@ class PostalCodeBEFromBestAddress
|
||||
{
|
||||
private const RELEASE = 'https://gitea.champs-libres.be/api/v1/repos/Chill-project/belgian-bestaddresses-transform/releases/tags/v1.0.0';
|
||||
|
||||
public function __construct(private PostalCodeBaseImporter $baseImporter, private HttpClientInterface $client, private LoggerInterface $logger)
|
||||
public function __construct(private readonly PostalCodeBaseImporter $baseImporter, private readonly HttpClientInterface $client, private readonly LoggerInterface $logger)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -82,8 +82,8 @@ class PostalCodeBEFromBestAddress
|
||||
{
|
||||
$this->baseImporter->importCode(
|
||||
'BE',
|
||||
trim($record['municipality_name']),
|
||||
trim($record['postal_info_objectid']),
|
||||
trim((string) $record['municipality_name']),
|
||||
trim((string) $record['postal_info_objectid']),
|
||||
$record['municipality_objectid'],
|
||||
'bestaddress',
|
||||
(float) $record['Y'],
|
||||
|
@@ -57,7 +57,7 @@ class PostalCodeBaseImporter
|
||||
|
||||
private array $waitingForInsert = [];
|
||||
|
||||
public function __construct(private Connection $defaultConnection)
|
||||
public function __construct(private readonly Connection $defaultConnection)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,7 @@ class PostalCodeFRFromOpenData
|
||||
{
|
||||
private const CSV = 'https://datanova.legroupe.laposte.fr/explore/dataset/laposte_hexasmal/download/?format=csv&timezone=Europe/Berlin&lang=fr&use_labels_for_header=true&csv_separator=%3B';
|
||||
|
||||
public function __construct(private PostalCodeBaseImporter $baseImporter, private HttpClientInterface $client, private LoggerInterface $logger)
|
||||
public function __construct(private readonly PostalCodeBaseImporter $baseImporter, private readonly HttpClientInterface $client, private readonly LoggerInterface $logger)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -72,17 +72,17 @@ class PostalCodeFRFromOpenData
|
||||
$lat = $lon = 0.0;
|
||||
}
|
||||
|
||||
$ref = trim($record['Code_commune_INSEE']);
|
||||
$ref = trim((string) $record['Code_commune_INSEE']);
|
||||
|
||||
if (str_starts_with($ref, '987')) {
|
||||
// some differences in French Polynesia
|
||||
$ref .= '.' . trim($record['Libellé_d_acheminement']);
|
||||
$ref .= '.' . trim((string) $record['Libellé_d_acheminement']);
|
||||
}
|
||||
|
||||
$this->baseImporter->importCode(
|
||||
'FR',
|
||||
trim($record['Libellé_d_acheminement']),
|
||||
trim($record['Code_postal']),
|
||||
trim((string) $record['Libellé_d_acheminement']),
|
||||
trim((string) $record['Code_postal']),
|
||||
$ref,
|
||||
'INSEE',
|
||||
$lat,
|
||||
|
Reference in New Issue
Block a user