Completed
Push — master ( 42a7e0...afcc87 )
by n
01:50
created

ContainerAwareApplication   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 3
dl 0
loc 17
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDispatcher() 0 4 1
1
<?php
2
3
namespace N1215\CakeCandle\Http;
4
5
use Cake\Event\EventManager;
6
use Cake\Http\ActionDispatcher;
7
use Cake\Http\BaseApplication;
8
use Cake\Routing\DispatcherFactory;
9
use N1215\CakeCandle\ContainerBagLocator;
10
11
trait ContainerAwareApplication
12
{
13
    /**
14
     * @return EventManager
15
     * @see BaseApplication::getEventManager()
16
     */
17
    abstract public function getEventManager();
18
19
    /**
20
     * Get the ActionDispatcher.
21
     * @return ActionDispatcher
22
     * @see BaseApplication::getDispatcher()
23
     */
24 1
    protected function getDispatcher()
25
    {
26 1
        $controllerFactory = new ControllerFactory(ContainerBagLocator::get());
27 1
        return new ActionDispatcher($controllerFactory, $this->getEventManager(), DispatcherFactory::filters());
28
    }
29
}
30