CoreServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 17 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
}