mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-07 15:25:00 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -22,20 +22,8 @@ class AddressReferenceBEFromBestAddress
|
||||
{
|
||||
private const RELEASE = 'https://gitea.champs-libres.be/api/v1/repos/Chill-project/belgian-bestaddresses-transform/releases/tags/v1.0.0';
|
||||
|
||||
private AddressReferenceBaseImporter $baseImporter;
|
||||
|
||||
private AddressToReferenceMatcher $addressToReferenceMatcher;
|
||||
|
||||
private HttpClientInterface $client;
|
||||
|
||||
public function __construct(
|
||||
HttpClientInterface $client,
|
||||
AddressReferenceBaseImporter $baseImporter,
|
||||
AddressToReferenceMatcher $addressToReferenceMatcher
|
||||
) {
|
||||
$this->client = $client;
|
||||
$this->baseImporter = $baseImporter;
|
||||
$this->addressToReferenceMatcher = $addressToReferenceMatcher;
|
||||
public function __construct(private HttpClientInterface $client, private AddressReferenceBaseImporter $baseImporter, private AddressToReferenceMatcher $addressToReferenceMatcher)
|
||||
{
|
||||
}
|
||||
|
||||
public function import(string $lang, array $lists): void
|
||||
|
@@ -46,18 +46,12 @@ final class AddressReferenceBaseImporter
|
||||
|
||||
private ?string $currentSource = null;
|
||||
|
||||
private Connection $defaultConnection;
|
||||
|
||||
private bool $isInitialized = false;
|
||||
|
||||
private LoggerInterface $logger;
|
||||
|
||||
private array $waitingForInsert = [];
|
||||
|
||||
public function __construct(Connection $defaultConnection, LoggerInterface $logger)
|
||||
public function __construct(private Connection $defaultConnection, private LoggerInterface $logger)
|
||||
{
|
||||
$this->defaultConnection = $defaultConnection;
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function finalize(): void
|
||||
|
@@ -20,17 +20,8 @@ use function is_int;
|
||||
|
||||
class AddressReferenceFromBano
|
||||
{
|
||||
private AddressReferenceBaseImporter $baseImporter;
|
||||
|
||||
private AddressToReferenceMatcher $addressToReferenceMatcher;
|
||||
|
||||
private HttpClientInterface $client;
|
||||
|
||||
public function __construct(HttpClientInterface $client, AddressReferenceBaseImporter $baseImporter, AddressToReferenceMatcher $addressToReferenceMatcher)
|
||||
public function __construct(private HttpClientInterface $client, private AddressReferenceBaseImporter $baseImporter, private AddressToReferenceMatcher $addressToReferenceMatcher)
|
||||
{
|
||||
$this->client = $client;
|
||||
$this->baseImporter = $baseImporter;
|
||||
$this->addressToReferenceMatcher = $addressToReferenceMatcher;
|
||||
}
|
||||
|
||||
public function import(string $departementNo): void
|
||||
|
@@ -21,10 +21,6 @@ use Psr\Log\LoggerInterface;
|
||||
*/
|
||||
final class AddressToReferenceMatcher
|
||||
{
|
||||
private Connection $connection;
|
||||
|
||||
private LoggerInterface $logger;
|
||||
|
||||
private const LOG_PREFIX = '[address_to_reference_matcher] ';
|
||||
|
||||
private const SQL_MARK_TO_REVIEW_ADDRESS_UNMATCHING = <<<'SQL'
|
||||
@@ -68,10 +64,8 @@ final class AddressToReferenceMatcher
|
||||
'{{ reviewed }}' => Address::ADDR_REFERENCE_STATUS_REVIEWED
|
||||
];
|
||||
|
||||
public function __construct(Connection $connection, LoggerInterface $logger)
|
||||
public function __construct(private Connection $connection, private LoggerInterface $logger)
|
||||
{
|
||||
$this->connection = $connection;
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function checkAddressesMatchingReferences(): void
|
||||
|
@@ -43,18 +43,12 @@ final class GeographicalUnitBaseImporter
|
||||
*/
|
||||
private array $cachingStatements = [];
|
||||
|
||||
private Connection $defaultConnection;
|
||||
|
||||
private bool $isInitialized = false;
|
||||
|
||||
private LoggerInterface $logger;
|
||||
|
||||
private array $waitingForInsert = [];
|
||||
|
||||
public function __construct(Connection $defaultConnection, LoggerInterface $logger)
|
||||
public function __construct(private Connection $defaultConnection, private LoggerInterface $logger)
|
||||
{
|
||||
$this->defaultConnection = $defaultConnection;
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function finalize(): void
|
||||
|
@@ -21,17 +21,8 @@ class PostalCodeBEFromBestAddress
|
||||
{
|
||||
private const RELEASE = 'https://gitea.champs-libres.be/api/v1/repos/Chill-project/belgian-bestaddresses-transform/releases/tags/v1.0.0';
|
||||
|
||||
private PostalCodeBaseImporter $baseImporter;
|
||||
|
||||
private HttpClientInterface $client;
|
||||
|
||||
private LoggerInterface $logger;
|
||||
|
||||
public function __construct(PostalCodeBaseImporter $baseImporter, HttpClientInterface $client, LoggerInterface $logger)
|
||||
public function __construct(private PostalCodeBaseImporter $baseImporter, private HttpClientInterface $client, private LoggerInterface $logger)
|
||||
{
|
||||
$this->baseImporter = $baseImporter;
|
||||
$this->client = $client;
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function import(string $lang = 'fr'): void
|
||||
|
@@ -55,14 +55,10 @@ class PostalCodeBaseImporter
|
||||
*/
|
||||
private array $cachingStatements = [];
|
||||
|
||||
private Connection $defaultConnection;
|
||||
|
||||
private array $waitingForInsert = [];
|
||||
|
||||
public function __construct(
|
||||
Connection $defaultConnection
|
||||
) {
|
||||
$this->defaultConnection = $defaultConnection;
|
||||
public function __construct(private Connection $defaultConnection)
|
||||
{
|
||||
}
|
||||
|
||||
public function finalize(): void
|
||||
|
@@ -26,20 +26,8 @@ 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';
|
||||
|
||||
private PostalCodeBaseImporter $baseImporter;
|
||||
|
||||
private HttpClientInterface $client;
|
||||
|
||||
private LoggerInterface $logger;
|
||||
|
||||
public function __construct(
|
||||
PostalCodeBaseImporter $baseImporter,
|
||||
HttpClientInterface $client,
|
||||
LoggerInterface $logger
|
||||
) {
|
||||
$this->baseImporter = $baseImporter;
|
||||
$this->client = $client;
|
||||
$this->logger = $logger;
|
||||
public function __construct(private PostalCodeBaseImporter $baseImporter, private HttpClientInterface $client, private LoggerInterface $logger)
|
||||
{
|
||||
}
|
||||
|
||||
public function import(): void
|
||||
@@ -86,7 +74,7 @@ class PostalCodeFRFromOpenData
|
||||
|
||||
$ref = trim($record['Code_commune_INSEE']);
|
||||
|
||||
if ('987' === substr($ref, 0, 3)) {
|
||||
if (str_starts_with($ref, '987')) {
|
||||
// some differences in French Polynesia
|
||||
$ref .= '.' . trim($record['Libellé_d_acheminement']);
|
||||
}
|
||||
|
Reference in New Issue
Block a user