style updates

This commit is contained in:
Mark Gregory
2026-06-23 13:39:02 +01:00
parent e79cadc7f8
commit 3be4ff590f
129 changed files with 482 additions and 404 deletions
@@ -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();
}
}