1
|
|
|
<?php namespace Comodojo\Dispatcher\Events; |
2
|
|
|
|
3
|
|
|
use \Comodojo\Dispatcher\Request\Model as Request; |
4
|
|
|
use \Comodojo\Dispatcher\Router\Model as Router; |
5
|
|
|
use \Comodojo\Dispatcher\Response\Model as Response; |
6
|
|
|
use \Comodojo\Dispatcher\Extra\Model as Extra; |
7
|
|
|
use \Comodojo\Foundation\Events\AbstractEvent; |
8
|
|
|
use \Psr\Log\LoggerInterface; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* @package Comodojo Dispatcher |
12
|
|
|
* @author Marco Giovinazzi <[email protected]> |
13
|
|
|
* @author Marco Castiello <[email protected]> |
14
|
|
|
* @license GPL-3.0+ |
15
|
|
|
* |
16
|
|
|
* LICENSE: |
17
|
|
|
* |
18
|
|
|
* This program is free software: you can redistribute it and/or modify |
19
|
|
|
* it under the terms of the GNU Affero General Public License as |
20
|
|
|
* published by the Free Software Foundation, either version 3 of the |
21
|
|
|
* License, or (at your option) any later version. |
22
|
|
|
* |
23
|
|
|
* This program is distributed in the hope that it will be useful, |
24
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
25
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
26
|
|
|
* GNU Affero General Public License for more details. |
27
|
|
|
* |
28
|
|
|
* You should have received a copy of the GNU Affero General Public License |
29
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
30
|
|
|
*/ |
31
|
|
|
|
32
|
|
|
class ServiceEvent extends AbstractEvent { |
33
|
|
|
|
34
|
|
|
protected $logger; |
35
|
|
|
|
36
|
|
|
protected $request; |
37
|
|
|
|
38
|
|
|
protected $router; |
39
|
|
|
|
40
|
|
|
protected $response; |
41
|
|
|
|
42
|
|
|
protected $extra; |
43
|
|
|
|
44
|
1 |
|
public function __construct( |
45
|
|
|
$name, |
46
|
|
|
LoggerInterface $logger, |
47
|
|
|
Request $request, |
48
|
|
|
Router $router, |
49
|
|
|
Response $response, |
50
|
|
|
Extra $extra |
51
|
|
|
) { |
52
|
|
|
|
53
|
1 |
|
parent::__construct($name); |
54
|
|
|
|
55
|
1 |
|
$this->logger = $logger; |
56
|
|
|
|
57
|
1 |
|
$this->request = $request; |
58
|
|
|
|
59
|
1 |
|
$this->router = $router; |
60
|
|
|
|
61
|
1 |
|
$this->response = $response; |
62
|
|
|
|
63
|
1 |
|
$this->extra = $extra; |
64
|
|
|
|
65
|
1 |
|
} |
66
|
|
|
|
67
|
|
|
public function getLogger() { |
68
|
|
|
|
69
|
|
|
return $this->logger; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
public function getRequest() { |
73
|
|
|
|
74
|
|
|
return $this->request; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
public function getRouter() { |
78
|
|
|
|
79
|
|
|
return $this->router; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
public function getResponse() { |
83
|
|
|
|
84
|
|
|
return $this->response; |
85
|
|
|
} |
86
|
|
|
|
87
|
1 |
|
public function getExtra() { |
88
|
|
|
|
89
|
1 |
|
return $this->extra; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
} |
93
|
|
|
|