Skip to content

Commit ef46077

Browse files
committed
if not set, the plugin manager getter will return a default, empty plugin manager
1 parent 6135023 commit ef46077

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/AbstractController.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Psr\Http\Message\ResponseInterface;
1919
use Psr\Http\Message\ServerRequestInterface;
2020
use Zend\EventManager\EventManagerAwareInterface;
21+
use Zend\ServiceManager\ServiceManager;
2122

2223
/**
2324
* Class AbstractController
@@ -120,6 +121,9 @@ public function plugin(string $name, array $options = []): PluginInterface
120121
*/
121122
public function getPluginManager(): PluginManager
122123
{
124+
if (!$this->pluginManager) {
125+
$this->pluginManager = new PluginManager(new ServiceManager(), []);
126+
}
123127
return $this->pluginManager;
124128
}
125129

0 commit comments

Comments
 (0)