1 | <?php namespace Comodojo\Extender\Socket\Messages\Task; |
||
22 | class Request implements Serializable { |
||
23 | |||
24 | use TasksRequestTrait; |
||
25 | |||
26 | protected $parameters = []; |
||
27 | |||
28 | protected $done; |
||
29 | |||
30 | protected $fail; |
||
31 | |||
32 | protected $pipe; |
||
33 | |||
34 | // public function __construct($name, $task, array $parameters = null) { |
||
|
|||
35 | // |
||
36 | // $this->setName($name); |
||
37 | // $this->setTask($task); |
||
38 | // $this->setParameters($parameters); |
||
39 | // |
||
40 | // } |
||
41 | |||
42 | 9 | public function setParameters(array $parameters = null) { |
|
49 | |||
50 | 9 | public function getParameters() { |
|
55 | |||
56 | public function getOnDone() { |
||
61 | |||
62 | 3 | public function onDone(Request $request = null) { |
|
69 | |||
70 | public function getOnFail() { |
||
75 | |||
76 | 6 | public function onFail(Request $request = null) { |
|
83 | |||
84 | public function getPipe() { |
||
89 | |||
90 | 3 | public function pipe(Request $request = null) { |
|
97 | |||
98 | public function import(array $data) { |
||
111 | |||
112 | 9 | public function export() { |
|
113 | |||
114 | return [ |
||
115 | 9 | 'name' => $this->getName(), |
|
116 | 9 | 'task' => $this->getTask(), |
|
117 | 9 | 'niceness' => $this->getNiceness(), |
|
118 | 9 | 'maxtime' => $this->getMaxtime(), |
|
119 | 9 | 'parameters' => $this->getParameters(), |
|
120 | 9 | 'done' => empty($this->done) ? null : $this->done->export(), |
|
121 | 9 | 'fail' => empty($this->fail) ? null : $this->fail->export(), |
|
122 | 9 | 'pipe' => empty($this->pipe) ? null : $this->pipe->export() |
|
123 | ]; |
||
124 | |||
125 | } |
||
126 | |||
127 | public function serialize() { |
||
132 | |||
133 | public function unserialize($data) { |
||
140 | |||
141 | 9 | public static function create($name, $task, array $parameters = null) { |
|
150 | |||
151 | public static function createFromExport(array $export) { |
||
159 | |||
160 | } |
||
161 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.