Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@
},
"conflict": {
"doctrine/dbal": "<3.0",
"doctrine/doctrine-orm-module": "<4.1",
"doctrine/doctrine-orm-module": "<6.3.0",
"laminas/laminas-mvc": "<3.8",
"laminas/laminas-servicemanager": "<3.10",
"mezzio/mezzio": "<3.20.1",
"laminas/laminas-mvc-console": "*"
},
"require-dev": {
"doctrine/dbal": "^3.9.3",
"doctrine/doctrine-orm-module": "^4.2.1 || ^5.3",
"doctrine/doctrine-orm-module": "^6.3.0",
"kahlan/kahlan": "^6.1",
"laminas/laminas-cli": "^1.11",
"laminas/laminas-coding-standard": "^3.0",
Expand Down
38 changes: 38 additions & 0 deletions spec/Fixture/LaminasCacheModule.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

declare(strict_types=1);

namespace ErrorHeroModule\Spec\Fixture;

use Laminas\Cache\ConfigProvider as LaminasCacheConfigProvider;
use Laminas\Cache\Storage\Adapter\Filesystem\AdapterPluginManagerDelegatorFactory as FilesystemAdapterPluginManagerDelegatorFactory;
use Laminas\Cache\Storage\Adapter\Memory\AdapterPluginManagerDelegatorFactory as MemoryAdapterPluginManagerDelegatorFactory;
use Laminas\Cache\Storage\AdapterPluginManager;

final class LaminasCacheModule
{
/** @return array<string, mixed> */
public function getConfig(): array
{
$configProvider = new LaminasCacheConfigProvider();

// laminas-cache exposes its ServiceManager wiring under the `dependencies` key.
// Laminas MVC consumes `service_manager`, so we map it here.
//
// Also include the installed adapter packages' delegators so the AdapterPluginManager
// knows how to create the configured adapters (e.g. Memory, Filesystem).
$serviceManagerConfig = $configProvider->getDependencyConfig();
$serviceManagerConfig['delegators'][AdapterPluginManager::class] ??= [];
$serviceManagerConfig['delegators'][AdapterPluginManager::class] = array_values(array_unique(array_merge(
$serviceManagerConfig['delegators'][AdapterPluginManager::class],
[
MemoryAdapterPluginManagerDelegatorFactory::class,
FilesystemAdapterPluginManagerDelegatorFactory::class,
]
)));

return [
'service_manager' => $serviceManagerConfig,
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Doctrine\ORM\EntityManager;
use ErrorHeroModule\Command\Preview\ErrorPreviewConsoleCommand;
use ErrorHeroModule\Spec\Fixture\LaminasCacheModule;
use Laminas\Mvc\Application;
use Symfony\Component\Console\Tester\CommandTester;

Expand All @@ -14,6 +15,7 @@
$application = Application::init([
'modules' => [
'Laminas\Router',
LaminasCacheModule::class,
'DoctrineModule',
'DoctrineORMModule',
'ErrorHeroModule',
Expand Down
Loading