1616use Laminas \ModuleManager \Listener \ServiceListener ;
1717
1818/**
19- * Native ServiceManagerConfig that replicates Laminas\Mvc\Service\ServiceManagerConfig
20- * but without MVC dependencies - only the core service management functionality
19+ * Native ServiceManagerConfig.
20+ * Replicates the essential service management functionality while avoiding Laminas mvc dependencies.
2121 */
2222class MvcServiceManagerConfig
2323{
@@ -33,7 +33,7 @@ class MvcServiceManagerConfig
3333 */
3434 public function __construct (array $ config = [])
3535 {
36- // Core configuration exactly matching original Laminas\Mvc\Service\ServiceManagerConfig
36+ // Core configuration
3737 $ this ->config = [
3838 'abstract_factories ' => [],
3939 'aliases ' => [
@@ -50,7 +50,7 @@ public function __construct(array $config = [])
5050 'EventManager ' => function ($ container ) {
5151 $ sharedManager = $ container ->has ('SharedEventManager ' ) ?
5252 $ container ->get ('SharedEventManager ' ) : null ;
53- return new \ Laminas \ EventManager \ EventManager ($ sharedManager );
53+ return new EventManager ($ sharedManager );
5454 },
5555 'ModuleManager ' => ModuleManagerFactory::class,
5656 'ServiceListener ' => ServiceListenerFactory::class,
@@ -64,17 +64,17 @@ public function __construct(array $config = [])
6464 ],
6565 ];
6666
67- // Add ServiceManager factory (same as original)
67+ // Add ServiceManager factory
6868 $ this ->config ['factories ' ]['ServiceManager ' ] = function ($ container ) {
6969 return $ container ;
7070 };
7171
72- // Add SharedEventManager factory (same as original)
72+ // Add SharedEventManager factory
7373 $ this ->config ['factories ' ]['SharedEventManager ' ] = function () {
74- return new \ Laminas \ EventManager \ SharedEventManager ();
74+ return new SharedEventManager ();
7575 };
7676
77- // Add EventManagerAware initializer (same as original)
77+ // Add EventManagerAware initializer
7878 $ this ->config ['initializers ' ]['EventManagerAwareInitializer ' ] = function ($ container , $ instance ) {
7979 if (!$ instance instanceof \Laminas \EventManager \EventManagerAwareInterface) {
8080 return ;
@@ -96,30 +96,28 @@ public function __construct(array $config = [])
9696 }
9797
9898 /**
99- * Configure service manager (same API as Laminas\Mvc\Service\ServiceManagerConfig)
99+ * Configure service manager
100100 *
101101 * @param ServiceManager $serviceManager
102102 * @return ServiceManager
103103 */
104104 public function configureServiceManager (ServiceManager $ serviceManager ): ServiceManager
105105 {
106- // Add ServiceManager service reference (same as Laminas)
106+ // Add ServiceManager service reference
107107 $ this ->config ['services ' ][ServiceManager::class] = $ serviceManager ;
108108
109- // Enable override during bootstrapping (same as Laminas)
109+ // Enable override during bootstrapping
110110 $ serviceManager ->setAllowOverride (true );
111-
112- // Configure the service manager using Laminas ServiceManager's native configure method
113111 $ serviceManager ->configure ($ this ->config );
114112
115- // Disable override after configuration (same as Laminas)
113+ // Disable override after configuration
116114 $ serviceManager ->setAllowOverride (false );
117115
118116 return $ serviceManager ;
119117 }
120118
121119 /**
122- * Return all service configuration (same API as Laminas)
120+ * Return all service configuration
123121 *
124122 * @return array
125123 */
0 commit comments