style updates

This commit is contained in:
Mark Gregory
2026-07-24 14:59:44 +01:00
parent 24ab771cd3
commit dd23205d0b
482 changed files with 7173 additions and 1435 deletions
@@ -6,5 +6,6 @@ interface ModuleRegistry
{
/** @return array<int, array{name:string, alias:string, version:string, enabled:bool}> */
public function all(): array;
public function enabled(string $name): bool;
}
@@ -3,9 +3,9 @@
namespace Modules\Core\Providers;
use Illuminate\Support\ServiceProvider;
use Modules\Core\Support\ModuleInfo;
use Modules\Core\Contracts\ModuleRegistry;
use Modules\Core\Services\LaravelModuleRegistry;
use Modules\Core\Support\ModuleInfo;
final class CoreServiceProvider extends ServiceProvider
{
-2
View File
@@ -1,5 +1,3 @@
<?php
use Illuminate\Support\Facades\Route;
// Module routes are intentionally registered by each feature as it is enabled.
@@ -21,14 +21,18 @@ final class LaravelModuleRegistry implements ModuleRegistry
];
}
usort($modules, fn (array $a, array $b): int => $a['name'] <=> $b['name']);
return $modules;
}
public function enabled(string $name): bool
{
foreach ($this->all() as $module) {
if (strcasecmp($module['name'], $name) === 0) return $module['enabled'];
if (strcasecmp($module['name'], $name) === 0) {
return $module['enabled'];
}
}
return false;
}
}
+9 -2
View File
@@ -4,6 +4,13 @@ namespace Modules\Core\Support;
final class ModuleInfo
{
public static function name(): string { return 'Core'; }
public static function nameLower(): string { return 'core'; }
public static function name(): string
{
return 'Core';
}
public static function nameLower(): string
{
return 'core';
}
}