style updates
This commit is contained in:
@@ -273,7 +273,7 @@ class IsoCountriesSeeder extends Seeder
|
||||
'iso_status' => 'official',
|
||||
'source' => 'bundled-iso-3166-1',
|
||||
'source_version' => '2026-06-15',
|
||||
])
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class IsoCountrySubdivisionsSeeder extends Seeder
|
||||
'last_synced_at' => $now,
|
||||
'source' => 'bundled-bootstrap',
|
||||
'source_version' => '2026-06-15',
|
||||
]
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@ if (! function_exists('countries_feature_enabled')) {
|
||||
*/
|
||||
function countries_feature_enabled(string $key): bool
|
||||
{
|
||||
return (bool) config(ModuleInfo::nameLower().".features.{$key}", false);
|
||||
return (bool) config(ModuleInfo::nameLower() . ".features.{$key}", false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function registerMigrations(): void
|
||||
{
|
||||
$path = dirname(__DIR__).'/Database/Migrations';
|
||||
$path = dirname(__DIR__) . '/Database/Migrations';
|
||||
|
||||
if (is_dir($path)) {
|
||||
$this->loadMigrationsFrom($path);
|
||||
@@ -51,7 +51,7 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function registerHelpers(): void
|
||||
{
|
||||
foreach (glob(dirname(__DIR__).'/Helpers/*.php') ?: [] as $filename) {
|
||||
foreach (glob(dirname(__DIR__) . '/Helpers/*.php') ?: [] as $filename) {
|
||||
require_once $filename;
|
||||
}
|
||||
}
|
||||
@@ -61,14 +61,14 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function registerCommands(): void
|
||||
{
|
||||
$commandPath = dirname(__DIR__).'/Console';
|
||||
$commandPath = dirname(__DIR__) . '/Console';
|
||||
|
||||
if (! is_dir($commandPath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$commands = collect(File::allFiles($commandPath))
|
||||
->map(fn ($file): string => 'Modules\\'.$this->moduleName.'\\Console\\'.$file->getFilenameWithoutExtension())
|
||||
->map(fn ($file): string => 'Modules\\' . $this->moduleName . '\\Console\\' . $file->getFilenameWithoutExtension())
|
||||
->filter(fn (string $class): bool => class_exists($class))
|
||||
->values()
|
||||
->all();
|
||||
@@ -83,14 +83,14 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function registerConfig(): void
|
||||
{
|
||||
$sourcePath = dirname(__DIR__).'/Config/config.php';
|
||||
$sourcePath = dirname(__DIR__) . '/Config/config.php';
|
||||
|
||||
if (! is_file($sourcePath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->publishes([
|
||||
$sourcePath => config_path(ModuleInfo::nameLower().'.php'),
|
||||
$sourcePath => config_path(ModuleInfo::nameLower() . '.php'),
|
||||
], 'config');
|
||||
|
||||
$this->mergeConfigFrom($sourcePath, ModuleInfo::nameLower());
|
||||
@@ -101,8 +101,8 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function registerViews(): void
|
||||
{
|
||||
$viewPath = resource_path('views/modules/'.ModuleInfo::nameLower());
|
||||
$sourcePath = dirname(__DIR__).'/Resources/views';
|
||||
$viewPath = resource_path('views/modules/' . ModuleInfo::nameLower());
|
||||
$sourcePath = dirname(__DIR__) . '/Resources/views';
|
||||
|
||||
if (! is_dir($sourcePath)) {
|
||||
return;
|
||||
@@ -110,7 +110,7 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
|
||||
$this->publishes([
|
||||
$sourcePath => $viewPath,
|
||||
], ['views', ModuleInfo::nameLower().'-module-views']);
|
||||
], ['views', ModuleInfo::nameLower() . '-module-views']);
|
||||
|
||||
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), ModuleInfo::nameLower());
|
||||
}
|
||||
@@ -120,8 +120,8 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function registerTranslations(): void
|
||||
{
|
||||
$publishedPath = resource_path('lang/modules/'.ModuleInfo::nameLower());
|
||||
$sourcePath = dirname(__DIR__).'/Resources/lang';
|
||||
$publishedPath = resource_path('lang/modules/' . ModuleInfo::nameLower());
|
||||
$sourcePath = dirname(__DIR__) . '/Resources/lang';
|
||||
|
||||
if (is_dir($publishedPath)) {
|
||||
$this->loadTranslationsFrom($publishedPath, ModuleInfo::nameLower());
|
||||
@@ -144,8 +144,8 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
$paths = [];
|
||||
|
||||
foreach (Config::get('view.paths', []) as $path) {
|
||||
if (is_dir($path.'/modules/'.ModuleInfo::nameLower())) {
|
||||
$paths[] = $path.'/modules/'.ModuleInfo::nameLower();
|
||||
if (is_dir($path . '/modules/' . ModuleInfo::nameLower())) {
|
||||
$paths[] = $path . '/modules/' . ModuleInfo::nameLower();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class RouteServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function mapWebRoutes(): void
|
||||
{
|
||||
$path = dirname(__DIR__).'/Routes/web.php';
|
||||
$path = dirname(__DIR__) . '/Routes/web.php';
|
||||
|
||||
if (is_file($path)) {
|
||||
Route::middleware(['web', 'auth'])->group($path);
|
||||
@@ -33,7 +33,7 @@ class RouteServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function mapApiRoutes(): void
|
||||
{
|
||||
$path = dirname(__DIR__).'/Routes/api.php';
|
||||
$path = dirname(__DIR__) . '/Routes/api.php';
|
||||
|
||||
if (is_file($path)) {
|
||||
Route::middleware(['api'])->prefix('api/v1')->group($path);
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
|
||||
use Modules\Countries\Http\Controllers\CountriesController;
|
||||
use Modules\Countries\Http\Controllers\CountrySyncController;
|
||||
use Modules\Countries\Http\Controllers\ReferenceDataController;
|
||||
|
||||
@@ -69,7 +69,7 @@ final class Iso3166
|
||||
$country = self::normaliseAlpha2($countryAlpha2);
|
||||
$code = strtoupper(trim($subdivisionCode));
|
||||
|
||||
if (str_starts_with($code, $country.'-')) {
|
||||
if (str_starts_with($code, $country . '-')) {
|
||||
return $code;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ final class Iso3166
|
||||
throw new InvalidArgumentException('ISO 3166-2 subdivision codes must contain 1 to 6 letters or numbers after the country prefix.');
|
||||
}
|
||||
|
||||
return $country.'-'.$code;
|
||||
return $country . '-' . $code;
|
||||
}
|
||||
|
||||
public static function flagEmoji(string $alpha2): string
|
||||
@@ -85,6 +85,6 @@ final class Iso3166
|
||||
$alpha2 = self::normaliseAlpha2($alpha2);
|
||||
$base = 127397;
|
||||
|
||||
return mb_chr($base + ord($alpha2[0]), 'UTF-8').mb_chr($base + ord($alpha2[1]), 'UTF-8');
|
||||
return mb_chr($base + ord($alpha2[0]), 'UTF-8') . mb_chr($base + ord($alpha2[1]), 'UTF-8');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user