CoreServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 9.7
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the jade/jade package.
5
 *
6
 * (c) Slince <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Jade;
13
14
use Jade\Middleware\MiddlewareFactory;
15
use Symfony\Component\EventDispatcher\EventDispatcher;
16
use Zend\Stratigility\MiddlewarePipe;
17
18
class CoreServiceProvider implements ServiceProviderInterface
19
{
20
    public function register(ContainerInterface $container)
21
    {
22
        // 事件管理
23
        $container['event_dispatcher'] = function(){
24
            return new EventDispatcher();
25
        };
26
        // middleware 控制
27
        $container['middleware_pipeline'] = function(){
28
            return new MiddlewarePipe();
29
        };
30
        // middleware 控制
31
        $container['middleware_factory'] = function(){
32
            return new MiddlewareFactory();
33
        };
34
        // route collector
35
        $container['route_collector'] = $container->get('app');
36
    }
37
}