Application::getDispatcher()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace Tequilarapido\Cli;
2
3
use KevinGH\Amend\Command;
4
use KevinGH\Amend\Helper;
5
use Symfony\Component\Console\Application as BaseApplication;
6
use Symfony\Component\EventDispatcher\EventDispatcher;
7
8
class Application extends BaseApplication
9
{
10
    protected $appDispatcher;
11
12
    public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
13
    {
14
        parent::__construct($name, $version);
15
16
        $this->appDispatcher = new EventDispatcher();
17
        $this->setDispatcher($this->appDispatcher);
18
    }
19
20
    public function getDispatcher()
21
    {
22
        return $this->appDispatcher;
23
    }
24
25
    public function addUpdateCommand($manifestURL)
26
    {
27
        $updateCommand = new Command('self-update');
28
        $updateCommand->setManifestUri($manifestURL);
29
        $this->getHelperSet()->set(new Helper());
30
        $this->add($updateCommand);
31
    }
32
}
33
34
35