Skip to content

Commit 25c9e48

Browse files
committed
if plugin manager is not set, throw an exception with possible reasons
1 parent ef46077 commit 25c9e48

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/AbstractController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Dot\Controller;
1111

1212
use Dot\Controller\Event\DispatchControllerEventsTrait;
13+
use Dot\Controller\Exception\RuntimeException;
1314
use Dot\Controller\Plugin\PluginInterface;
1415
use Dot\Controller\Plugin\PluginManager;
1516
use Dot\Controller\Plugin\PluginManagerAwareInterface;
@@ -122,7 +123,8 @@ public function plugin(string $name, array $options = []): PluginInterface
122123
public function getPluginManager(): PluginManager
123124
{
124125
if (!$this->pluginManager) {
125-
$this->pluginManager = new PluginManager(new ServiceManager(), []);
126+
throw new RuntimeException('Controller plugin manager not set. Enable the controller module by merging' .
127+
'its ConfigProvider and make sure the controller is registered in the service manager');
126128
}
127129
return $this->pluginManager;
128130
}

0 commit comments

Comments
 (0)