Skip to content

Commit 26d63bf

Browse files
committed
AC-15068::Laminas MVC Retiring
1 parent 91803f7 commit 26d63bf

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

lib/internal/Magento/Framework/Setup/Mvc/MvcApplication.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class MvcApplication
2323
private ServiceManager $serviceManager;
2424

2525
/**
26-
* Constructor (compatible with Laminas\Mvc\Application)
26+
* Class constructor
2727
*
2828
* @param ServiceManager $serviceManager
2929
*/
@@ -34,7 +34,7 @@ public function __construct(
3434
}
3535

3636
/**
37-
* Get service manager (same API as Laminas\Mvc\Application)
37+
* Get service manager
3838
*
3939
* @return ServiceManager
4040
*/
@@ -64,7 +64,7 @@ public function getConfig(): array
6464
}
6565

6666
/**
67-
* Bootstrap the application (same API as Laminas\Mvc\Application)
67+
* Bootstrap the application
6868
*
6969
* @param array $listeners
7070
* @return self
@@ -88,7 +88,7 @@ public function bootstrap(array $listeners = []): static
8888
}
8989

9090
/**
91-
* Initialize application (static method same as Laminas\Mvc\Application::init)
91+
* Initializes the application instance with services and configuration
9292
*
9393
* @param array $configuration
9494
* @return self

lib/internal/Magento/Framework/Setup/Mvc/MvcEvent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
namespace Magento\Framework\Setup\Mvc;
99

1010
/**
11-
* Native MvcEvent class that provides minimal compatibility with Laminas MvcEvent
12-
* for Magento setup commands without requiring Laminas MVC
11+
* Native MvcEvent class.
12+
* Magento setup commands without requiring Laminas mvc dependencies
1313
*/
1414
class MvcEvent
1515
{

lib/internal/Magento/Framework/Setup/Mvc/MvcServiceManagerConfig.php

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
use 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
*/
2222
class 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

Comments
 (0)