Skip to content

Commit 726538b

Browse files
committed
some autoload hacks
1 parent 4aa7519 commit 726538b

File tree

4 files changed

+30
-11
lines changed

4 files changed

+30
-11
lines changed

composer.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"psr7",
1919
"psr11",
2020
"psr15",
21-
"zend-view",
21+
"laminas-view",
2222
"twig",
2323
"plates",
2424
"symfony",
@@ -52,17 +52,19 @@
5252
},
5353
"conflict": {
5454
"doctrine/doctrine-orm-module": "<2.1",
55-
"elie29/zend-phpdi-config": "<4.0",
55+
"elie29/laminas-phpdi-config": "<4.0",
5656
"laminas/laminas-mvc": "<3.0 >=4.0",
5757
"laminas/laminas-servicemanager": "<3.3",
5858
"mezzio/mezzio": "<3.0 >=4.0"
5959
},
6060
"require-dev": {
6161
"aura/di": "^3.4",
6262
"doctrine/doctrine-orm-module": "^2.1",
63-
"elie29/zend-phpdi-config": "^4.0",
63+
"elie29/laminas-phpdi-config": "^4.0",
6464
"kahlan/kahlan": "^4.6.4",
65+
"laminas/laminas-cache": "^2.9",
6566
"laminas/laminas-coding-standard": "^2.0",
67+
"laminas/laminas-form": "^2.14",
6668
"laminas/laminas-mvc": "^3.0",
6769
"laminas/laminas-mvc-console": "^1.1",
6870
"laminas/laminas-servicemanager": "^3.3",
@@ -78,10 +80,10 @@
7880
"symfony/dependency-injection": "^4.0"
7981
},
8082
"suggest": {
81-
"laminas/laminas-mvc-console": "^1.1 for zend-mvc ^3.0 usage to be able to use Console Controller",
82-
"mezzio/mezzio-laminasviewrenderer": "^2.0 to be able to use zend-view template engine in zend-expressive ^3.0",
83-
"mezzio/mezzio-platesrenderer": "^2.0 to be able to use plates template engine in zend-expressive ^3.0",
84-
"mezzio/mezzio-twigrenderer": "^2.0 to be able to use twig template engine in zend-expressive ^3.0"
83+
"laminas/laminas-mvc-console": "^1.1 for laminas-mvc ^3.0 usage to be able to use Console Controller",
84+
"mezzio/mezzio-laminasviewrenderer": "^2.0 to be able to use laminas-view template engine in mezzio ^3.0",
85+
"mezzio/mezzio-platesrenderer": "^2.0 to be able to use plates template engine in mezzio ^3.0",
86+
"mezzio/mezzio-twigrenderer": "^2.0 to be able to use twig template engine in mezzio ^3.0"
8587
},
8688
"config": {
8789
"bin-dir": "bin",

kahlan-config.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44
use Kahlan\Reporter\Coverage;
55
use Kahlan\Reporter\Coverage\Driver\Xdebug;
66

7+
// autoload hack
8+
file_put_contents('vendor/laminas/laminas-zendframework-bridge/src/autoload.php', '');
9+
class_alias(Laminas\Cache\PatternPluginManager\PatternPluginManagerV2Polyfill::class, Zend\Cache\PatternPluginManager\PatternPluginManagerV2Polyfill::class);
10+
class_alias(Laminas\Form\FormElementManager\FormElementManagerV3Polyfill::class, Zend\Form\FormElementManager\FormElementManagerV2Polyfill::class);
11+
class_alias(Laminas\ServiceManager\AbstractPluginManager::class, Zend\ServiceManager\AbstractPluginManager::class);
12+
class_alias(Laminas\ModuleManager\Feature\ConfigProviderInterface::class, Zend\ModuleManager\Feature\ConfigProviderInterface::class);
13+
class_alias(Laminas\ModuleManager\Feature\InitProviderInterface::class, Zend\ModuleManager\Feature\InitProviderInterface::class);
14+
class_alias(Laminas\ModuleManager\ModuleManagerInterface::class, Zend\ModuleManager\ModuleManagerInterface::class);
15+
class_alias(Laminas\ModuleManager\Feature\BootstrapListenerInterface::class, Zend\ModuleManager\Feature\BootstrapListenerInterface::class);
16+
class_alias(Laminas\EventManager\EventInterface::class, Zend\EventManager\EventInterface::class);
17+
class_alias(Laminas\ModuleManager\Feature\ControllerProviderInterface::class, Zend\ModuleManager\Feature\ControllerProviderInterface::class);
18+
class_alias(Laminas\ModuleManager\Feature\DependencyIndicatorInterface::class, Zend\ModuleManager\Feature\DependencyIndicatorInterface::class);
19+
class_alias(Laminas\ServiceManager\AbstractFactoryInterface::class, Zend\ServiceManager\AbstractFactoryInterface::class);
20+
class_alias(Laminas\ServiceManager\ServiceLocatorInterface::class, Zend\ServiceManager\ServiceLocatorInterface::class);
21+
class_alias(Laminas\ServiceManager\FactoryInterface::class, Zend\ServiceManager\FactoryInterface::class);
22+
class_alias(Laminas\Db\Adapter\AdapterInterface::class, Zend\Db\Adapter\AdapterInterface::class);
23+
724
Filters::apply($this, 'coverage', function($next) {
825
if (! extension_loaded('xdebug')) {
926
return;

spec/Middleware/MezzioFactorySpec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141

142142
describe('__invoke()', function () {
143143

144-
it('returns Mezzio Middleware instance with doctrine to zend-db conversion', function () {
144+
it('returns Mezzio Middleware instance with doctrine to laminas-db conversion', function () {
145145

146146
$config = $this->config;
147147
unset($config['db']);
@@ -185,7 +185,7 @@
185185

186186
});
187187

188-
it('returns Mezzio Middleware instance without doctrine to zend-db conversion', function () {
188+
it('returns Mezzio Middleware instance without doctrine to laminas-db conversion', function () {
189189

190190
$container = Double::instance(['extends' => ServiceManager::class, 'methods' => '__construct']);
191191
allow($container)->toReceive('get')->with('config')

src/Middleware/MezzioFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class MezzioFactory
4040
PHPDIContainerWrapper::class => PHPDIService::class,
4141
];
4242

43-
private function createMiddlewareInstance(ContainerInterface $container, array $configuration): Expressive
43+
private function createMiddlewareInstance(ContainerInterface $container, array $configuration): Mezzio
4444
{
4545
return new Mezzio(
4646
$configuration['error-hero-module'],
@@ -70,7 +70,7 @@ private function verifyConfig(iterable $configuration, string $containerClass):
7070
return $configuration;
7171
}
7272

73-
public function __invoke(ContainerInterface $container): Expressive
73+
public function __invoke(ContainerInterface $container): Mezzio
7474
{
7575
$configuration = $container->get('config');
7676

0 commit comments

Comments
 (0)