From 4b7329e32725743e3f3cf429ac238bb98bb6d231 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Thu, 21 Nov 2024 18:03:24 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Contracts/ProvinceSeeder.php | 1 - src/resources/database/seeds/CountiesOfHungary.php | 1 + src/resources/database/seeds/CountiesOfRomania.php | 1 + src/resources/database/seeds/IsProvinceSeeder.php | 3 +-- src/resources/database/seeds/ProvinceSeeders.php | 4 ++-- src/resources/database/seeds/ProvincesAndRegionsOfBelgium.php | 1 + .../database/seeds/ProvincesAndTerritoriesOfCanada.php | 1 + .../database/seeds/ProvincesAndTerritoriesOfCanadaFrench.php | 1 + src/resources/database/seeds/ProvincesOfIndonesia.php | 1 + src/resources/database/seeds/ProvincesOfNetherlands.php | 2 +- src/resources/database/seeds/StatesAndTerritoriesOfIndia.php | 1 + src/resources/database/seeds/StatesOfGermany.php | 1 + src/resources/database/seeds/StatesOfUsa.php | 1 + 13 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Contracts/ProvinceSeeder.php b/src/Contracts/ProvinceSeeder.php index e35b39b..1658e96 100644 --- a/src/Contracts/ProvinceSeeder.php +++ b/src/Contracts/ProvinceSeeder.php @@ -12,5 +12,4 @@ public static function getCountryCode(): string; * @return array|ProvinceType[] */ public static function getProvinceTypes(): array; - } diff --git a/src/resources/database/seeds/CountiesOfHungary.php b/src/resources/database/seeds/CountiesOfHungary.php index 5b4a212..d0014a5 100644 --- a/src/resources/database/seeds/CountiesOfHungary.php +++ b/src/resources/database/seeds/CountiesOfHungary.php @@ -23,6 +23,7 @@ class CountiesOfHungary extends Seeder implements ProvinceSeeder use IsProvinceSeeder; protected static string $forCountry = 'HU'; + protected static array $provinceTypes = [ProvinceType::COUNTY]; public function run() diff --git a/src/resources/database/seeds/CountiesOfRomania.php b/src/resources/database/seeds/CountiesOfRomania.php index 98bd9a3..7c056e6 100644 --- a/src/resources/database/seeds/CountiesOfRomania.php +++ b/src/resources/database/seeds/CountiesOfRomania.php @@ -23,6 +23,7 @@ class CountiesOfRomania extends Seeder implements ProvinceSeeder use IsProvinceSeeder; protected static string $forCountry = 'RO'; + protected static array $provinceTypes = [ProvinceType::COUNTY]; /** diff --git a/src/resources/database/seeds/IsProvinceSeeder.php b/src/resources/database/seeds/IsProvinceSeeder.php index b846b72..4377399 100644 --- a/src/resources/database/seeds/IsProvinceSeeder.php +++ b/src/resources/database/seeds/IsProvinceSeeder.php @@ -16,7 +16,6 @@ public static function getCountryCode(): string public static function getProvinceTypes(): array { - return array_map(fn(string|ProvinceType $type) => is_string($type) ? ProvinceTypeProxy::create($type): $type, self::$provinceTypes); + return array_map(fn (string|ProvinceType $type) => is_string($type) ? ProvinceTypeProxy::create($type) : $type, self::$provinceTypes); } - } diff --git a/src/resources/database/seeds/ProvinceSeeders.php b/src/resources/database/seeds/ProvinceSeeders.php index 79c570c..db168da 100644 --- a/src/resources/database/seeds/ProvinceSeeders.php +++ b/src/resources/database/seeds/ProvinceSeeders.php @@ -4,8 +4,8 @@ namespace Konekt\Address\Seeds; -use InvalidArgumentException; use Illuminate\Support\Str; +use InvalidArgumentException; use Konekt\Address\Contracts\ProvinceSeeder; use Konekt\Extend\Concerns\HasRegistry; use Konekt\Extend\Concerns\RequiresClassOrInterface; @@ -32,7 +32,7 @@ public static function make(string $id, array $parameters = []): object /** @return ProvinceSeeder[] */ public static function availableSeedersOfCountry(string $country): array { - return array_filter(self::$registry, fn($class) => $class::getCountryCode() === $country); + return array_filter(self::$registry, fn ($class) => $class::getCountryCode() === $country); } public static function extend(string $seederClass): void diff --git a/src/resources/database/seeds/ProvincesAndRegionsOfBelgium.php b/src/resources/database/seeds/ProvincesAndRegionsOfBelgium.php index 9863bd6..615c2bf 100644 --- a/src/resources/database/seeds/ProvincesAndRegionsOfBelgium.php +++ b/src/resources/database/seeds/ProvincesAndRegionsOfBelgium.php @@ -23,6 +23,7 @@ class ProvincesAndRegionsOfBelgium extends Seeder implements ProvinceSeeder use IsProvinceSeeder; protected static string $forCountry = 'BE'; + protected static array $provinceTypes = [ProvinceType::REGION, ProvinceType::PROVINCE]; public function run() diff --git a/src/resources/database/seeds/ProvincesAndTerritoriesOfCanada.php b/src/resources/database/seeds/ProvincesAndTerritoriesOfCanada.php index d30af01..181d10e 100644 --- a/src/resources/database/seeds/ProvincesAndTerritoriesOfCanada.php +++ b/src/resources/database/seeds/ProvincesAndTerritoriesOfCanada.php @@ -24,6 +24,7 @@ class ProvincesAndTerritoriesOfCanada extends Seeder implements ProvinceSeeder use IsProvinceSeeder; protected static string $forCountry = 'CA'; + protected static array $provinceTypes = [ProvinceType::PROVINCE, ProvinceType::TERRITORY]; public function run() diff --git a/src/resources/database/seeds/ProvincesAndTerritoriesOfCanadaFrench.php b/src/resources/database/seeds/ProvincesAndTerritoriesOfCanadaFrench.php index dd61952..fa8d892 100644 --- a/src/resources/database/seeds/ProvincesAndTerritoriesOfCanadaFrench.php +++ b/src/resources/database/seeds/ProvincesAndTerritoriesOfCanadaFrench.php @@ -24,6 +24,7 @@ class ProvincesAndTerritoriesOfCanadaFrench extends Seeder implements ProvinceSe use IsProvinceSeeder; protected static string $forCountry = 'CA'; + protected static array $provinceTypes = [ProvinceType::PROVINCE, ProvinceType::TERRITORY]; public function run() diff --git a/src/resources/database/seeds/ProvincesOfIndonesia.php b/src/resources/database/seeds/ProvincesOfIndonesia.php index dabaffc..b89c8bc 100644 --- a/src/resources/database/seeds/ProvincesOfIndonesia.php +++ b/src/resources/database/seeds/ProvincesOfIndonesia.php @@ -23,6 +23,7 @@ class ProvincesOfIndonesia extends Seeder implements ProvinceSeeder use IsProvinceSeeder; protected static string $forCountry = 'ID'; + protected static array $provinceTypes = [ProvinceType::UNIT, ProvinceType::PROVINCE, ProvinceType::REGION]; public function run() diff --git a/src/resources/database/seeds/ProvincesOfNetherlands.php b/src/resources/database/seeds/ProvincesOfNetherlands.php index afd9262..4fe0b8f 100644 --- a/src/resources/database/seeds/ProvincesOfNetherlands.php +++ b/src/resources/database/seeds/ProvincesOfNetherlands.php @@ -23,8 +23,8 @@ class ProvincesOfNetherlands extends Seeder implements ProvinceSeeder use IsProvinceSeeder; protected static string $forCountry = 'NL'; - protected static array $provinceTypes = [ProvinceType::PROVINCE]; + protected static array $provinceTypes = [ProvinceType::PROVINCE]; public function run() { diff --git a/src/resources/database/seeds/StatesAndTerritoriesOfIndia.php b/src/resources/database/seeds/StatesAndTerritoriesOfIndia.php index 5dd9d29..aad77ae 100644 --- a/src/resources/database/seeds/StatesAndTerritoriesOfIndia.php +++ b/src/resources/database/seeds/StatesAndTerritoriesOfIndia.php @@ -23,6 +23,7 @@ class StatesAndTerritoriesOfIndia extends Seeder implements ProvinceSeeder use IsProvinceSeeder; protected static string $forCountry = 'IN'; + protected static array $provinceTypes = [ProvinceType::STATE, ProvinceType::TERRITORY]; public function run() diff --git a/src/resources/database/seeds/StatesOfGermany.php b/src/resources/database/seeds/StatesOfGermany.php index 9c038c7..2ba4150 100644 --- a/src/resources/database/seeds/StatesOfGermany.php +++ b/src/resources/database/seeds/StatesOfGermany.php @@ -23,6 +23,7 @@ class StatesOfGermany extends Seeder implements ProvinceSeeder use IsProvinceSeeder; protected static string $forCountry = 'DE'; + protected static array $provinceTypes = [ProvinceType::STATE]; public function run() diff --git a/src/resources/database/seeds/StatesOfUsa.php b/src/resources/database/seeds/StatesOfUsa.php index c784c24..81d1311 100644 --- a/src/resources/database/seeds/StatesOfUsa.php +++ b/src/resources/database/seeds/StatesOfUsa.php @@ -23,6 +23,7 @@ class StatesOfUsa extends Seeder implements ProvinceSeeder use IsProvinceSeeder; protected static string $forCountry = 'US'; + protected static array $provinceTypes = [ProvinceType::STATE, ProvinceType::FEDERAL_DISTRICT, ProvinceType::MILITARY, ProvinceType::TERRITORY]; /**