refactor(addressbook): remove factory, extract filter-chip builder, split CSS
Remove AddressBookServicesFactory — all 8 dependencies already registered in DI container individually. Update container registrar to wire directly. Extract 42-line filter-chip builder from index().php into AddressBookService::buildCustomFieldChipMeta(). Split 576-line CSS file into functional layout (76 lines) and decorative banner animation (500 lines) with separate asset registration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,25 +5,28 @@ namespace MintyPHP\Module\AddressBook;
|
||||
use MintyPHP\App\AppContainer;
|
||||
use MintyPHP\App\Container\ContainerRegistrar;
|
||||
use MintyPHP\Module\AddressBook\Service\AddressBookService;
|
||||
use MintyPHP\Module\AddressBook\Service\AddressBookServicesFactory;
|
||||
use MintyPHP\Service\CustomField\CustomFieldServicesFactory;
|
||||
use MintyPHP\Service\Directory\DirectoryServicesFactory;
|
||||
use MintyPHP\Service\Access\RoleService;
|
||||
use MintyPHP\Service\CustomField\UserCustomFieldValueService;
|
||||
use MintyPHP\Service\Org\DepartmentService;
|
||||
use MintyPHP\Service\Tenant\TenantScopeService;
|
||||
use MintyPHP\Service\User\UserServicesFactory;
|
||||
use MintyPHP\Service\Tenant\TenantService;
|
||||
use MintyPHP\Service\User\UserAccountService;
|
||||
use MintyPHP\Service\User\UserAssignmentService;
|
||||
use MintyPHP\Service\User\UserAvatarService;
|
||||
|
||||
final class AddressBookContainerRegistrar implements ContainerRegistrar
|
||||
{
|
||||
public function register(AppContainer $container): void
|
||||
{
|
||||
$container->set(AddressBookServicesFactory::class, static fn (AppContainer $c): AddressBookServicesFactory => new AddressBookServicesFactory(
|
||||
$c->get(UserServicesFactory::class),
|
||||
$c->get(DirectoryServicesFactory::class),
|
||||
$c->get(CustomFieldServicesFactory::class),
|
||||
$c->get(TenantScopeService::class)
|
||||
$container->set(AddressBookService::class, static fn (AppContainer $c): AddressBookService => new AddressBookService(
|
||||
$c->get(UserAccountService::class),
|
||||
$c->get(UserAssignmentService::class),
|
||||
$c->get(TenantService::class),
|
||||
$c->get(DepartmentService::class),
|
||||
$c->get(RoleService::class),
|
||||
$c->get(TenantScopeService::class),
|
||||
$c->get(UserCustomFieldValueService::class),
|
||||
$c->get(UserAvatarService::class)
|
||||
));
|
||||
|
||||
$container->set(AddressBookService::class, static fn (AppContainer $c): AddressBookService => $c
|
||||
->get(AddressBookServicesFactory::class)
|
||||
->createAddressBookService());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user