Skip to content

Commit 370bf7a

Browse files
authored
Merge pull request #13 from dotkernel/develop
Develop
2 parents c69b336 + a58b81a commit 370bf7a

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## 0.3.1 - 2017-05-09
2+
3+
### Changed
4+
* throw a more appropriate error message in case controller was not initialized properly
5+
6+
### Added
7+
* Nothing
8+
9+
### Deprecated
10+
* Nothing
11+
12+
### Removed
13+
* Nothing
14+
15+
### Fixed
16+
* Nothing
17+
18+
119
## 0.3.0 - 2017-04-21
220

321
### Changed

src/AbstractController.php

Lines changed: 6 additions & 0 deletions
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;
@@ -18,6 +19,7 @@
1819
use Psr\Http\Message\ResponseInterface;
1920
use Psr\Http\Message\ServerRequestInterface;
2021
use Zend\EventManager\EventManagerAwareInterface;
22+
use Zend\ServiceManager\ServiceManager;
2123

2224
/**
2325
* Class AbstractController
@@ -120,6 +122,10 @@ public function plugin(string $name, array $options = []): PluginInterface
120122
*/
121123
public function getPluginManager(): PluginManager
122124
{
125+
if (!$this->pluginManager) {
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');
128+
}
123129
return $this->pluginManager;
124130
}
125131

0 commit comments

Comments
 (0)