bakaphp /
phalcon-api
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Gewaer\Providers; |
||
| 4 | |||
| 5 | use Phalcon\Di\ServiceProviderInterface; |
||
| 6 | use Phalcon\DiInterface; |
||
| 7 | use Namshi\Notificator\Manager; |
||
| 8 | use function Gewaer\Core\appPath; |
||
| 9 | |||
| 10 | class EventManagerProvider implements ServiceProviderInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @param DiInterface $container |
||
| 14 | */ |
||
| 15 | 71 | public function register(DiInterface $container) |
|
| 16 | { |
||
| 17 | 71 | $config = $container->getShared('config'); |
|
| 18 | |||
| 19 | 71 | $container->setShared( |
|
| 20 | 71 | 'manager', |
|
| 21 | function () use ($config) { |
||
| 22 | $manager = new Manager(); |
||
| 23 | |||
| 24 | $handlers = $this->providers = require appPath('api/config/handlers.php'); |
||
|
1 ignored issue
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 25 | |||
| 26 | //Pass Handlers as array |
||
| 27 | $manager->setHandlers($handlers); |
||
| 28 | |||
| 29 | return $manager; |
||
| 30 | 71 | } |
|
| 31 | ); |
||
| 32 | 71 | } |
|
| 33 | } |
||
| 34 |