/
Wild_RNB
/
ASU
Обзор
Документация
Войти
/
Wild_RNB
/
ASU
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
src/Runtime/ServiceManager.php
35 строк
708 B
am190620045-afk
Add ASU runtime service manager
15 июл 2026, 20:50
15 июл 2026, 20:50
1069ba2
Код
Авторство
О чём код?
<?php declare(strict_types=1); namespace ASU\Runtime; final class ServiceManager { private array $services = []; public function register(string $name, object $service): void { $this->services[$name] = $service; } public function boot(): array { foreach ($this->services as $service) { if (method_exists($service, 'boot')) { $service->boot(); } } return array_keys($this->services); } public function shutdown(): void { foreach ($this->services as $service) { if (method_exists($service, 'shutdown')) { $service->shutdown(); } } } }