Completed
Push — master ( dc7a60...9aa4ca )
by Taosikai
11:35
created

Application::getLoop()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Spike library
4
 * @author Tao <[email protected]>
5
 */
6
namespace Spike;
7
8
use React\EventLoop\Factory;
9
use React\EventLoop\LoopInterface;
10
use Slince\Di\Container;
11
use Slince\Event\Dispatcher;
12
use Spike\Logger\Logger;
13
use Symfony\Component\Console\Application as BaseApplication;
14
use Symfony\Component\Console\Input\InputInterface;
15
use Symfony\Component\Console\Output\OutputInterface;
16
17
class Application extends BaseApplication
18
{
19
    /**
20
     * @var Container
21
     */
22
    protected $container;
23
24
    /**
25
     * @var Dispatcher
26
     */
27
    protected $dispatcher;
28
29
    /**
30
     * @var Configuration
31
     */
32
    protected $configuration;
33
34
    /**
35
     * @var InputInterface
36
     */
37
    protected $input;
38
39
    /**
40
     * @var OutputInterface
41
     */
42
    protected $output;
43
44
    /**
45
     * @var Logger
46
     */
47
    protected $logger;
48
49
    /**
50
     * @var LoopInterface
51
     */
52
    protected $loop;
53
54
55
    public function __construct(Configuration $configuration, $name = null, $version = null)
56
    {
57
        $this->configuration = $configuration;
58
        $this->container = new Container();
59
        $this->dispatcher =  new Dispatcher();
60
        $this->loop = Factory::create();
61
        parent::__construct($name, $version);
62
    }
63
64
    /**
65
     * Gets the dispatcher
66
     * @return Dispatcher
67
     */
68
    public function getDispatcher()
69
    {
70
        return $this->dispatcher;
71
    }
72
73
    /**
74
     * @return Configuration
75
     */
76
    public function getConfiguration()
77
    {
78
        return $this->configuration;
79
    }
80
81
    /**
82
     * Gets the loop instance
83
     * @return LoopInterface
84
     */
85
    public function getLoop()
86
    {
87
        return $this->loop;
88
    }
89
90
    /**
91
     * Gets the logger instance
92
     * @return Logger
93
     */
94
    public function getLogger()
95
    {
96
        return $this->logger;
97
    }
98
99
    /**
100
     * @return InputInterface
101
     */
102
    public function getInput()
103
    {
104
        return $this->input;
105
    }
106
107
    /**
108
     * @return OutputInterface
109
     */
110
    public function getOutput()
111
    {
112
        return $this->output;
113
    }
114
}