|
1
|
|
|
<?php namespace Comodojo\Dispatcher\Router; |
|
2
|
|
|
|
|
3
|
|
|
use \Comodojo\Components\Model as DispatcherClassModel; |
|
4
|
|
|
use \Comodojo\Dispatcher\Components\Timestamp as TimestampTrait; |
|
5
|
|
|
use \Comodojo\Dispatcher\Request\Model as Request; |
|
6
|
|
|
use \Comodojo\Dispatcher\Response\Model as Response; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* |
|
10
|
|
|
* @package Comodojo dispatcher |
|
11
|
|
|
* @author Marco Giovinazzi <[email protected]> |
|
12
|
|
|
* @license GPL-3.0+ |
|
13
|
|
|
* |
|
14
|
|
|
* LICENSE: |
|
15
|
|
|
* |
|
16
|
|
|
* This program is free software: you can redistribute it and/or modify |
|
17
|
|
|
* it under the terms of the GNU Affero General Public License as |
|
18
|
|
|
* published by the Free Software Foundation, either version 3 of the |
|
19
|
|
|
* License, or (at your option) any later version. |
|
20
|
|
|
* |
|
21
|
|
|
* This program is distributed in the hope that it will be useful, |
|
22
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
23
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
24
|
|
|
* GNU Affero General Public License for more details. |
|
25
|
|
|
* |
|
26
|
|
|
* You should have received a copy of the GNU Affero General Public License |
|
27
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
28
|
|
|
*/ |
|
29
|
|
|
|
|
30
|
|
|
class Collector extends DispatcherClassModel { |
|
31
|
|
|
|
|
32
|
|
|
use TimestampTrait; |
|
33
|
|
|
|
|
34
|
|
|
private $bypass = false; |
|
35
|
|
|
|
|
36
|
|
|
public function __construct() { |
|
37
|
|
|
|
|
38
|
|
|
parent::__construct($configuration, $logger); |
|
|
|
|
|
|
39
|
|
|
|
|
40
|
|
|
$this->setTimestamp(); |
|
41
|
|
|
|
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
public function bypass($mode = true) { |
|
45
|
|
|
|
|
46
|
|
|
$this->bypass = filter_var($mode, FILTER_VALIDATE_BOOLEAN); |
|
47
|
|
|
|
|
48
|
|
|
return $this; |
|
49
|
|
|
|
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
public function route(Request $request) { |
|
53
|
|
|
|
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
public function compose(Response $response) { |
|
57
|
|
|
|
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
} |
|
61
|
|
|
|
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.