1 | <?php |
||
9 | class Client extends OriginalClient |
||
10 | { |
||
11 | private $logging = true; |
||
12 | private $log = []; |
||
13 | |||
14 | 62 | public function connect() |
|
15 | { |
||
16 | 62 | $start = microtime(1); |
|
17 | |||
18 | 62 | $result = parent::connect(); |
|
|
|||
19 | $this->log($start, Connection::class); |
||
20 | |||
21 | return $result; |
||
22 | } |
||
23 | |||
24 | 62 | public function sendRequest(Request $request) |
|
25 | { |
||
26 | 62 | $start = microtime(1); |
|
27 | 62 | $response = parent::sendRequest($request); |
|
28 | |||
29 | $this->log($start, get_class($request), $request->getBody(), $response->getData()); |
||
30 | |||
31 | return $response; |
||
32 | } |
||
33 | |||
34 | private function log($start, $class, $request = [], $response = []) |
||
35 | { |
||
36 | if ($this->logging) { |
||
37 | $this->log[] = new Event(microtime(1) - $start, $class, $request, $response); |
||
38 | } |
||
39 | } |
||
40 | |||
41 | public function setLogging($logging) |
||
45 | |||
46 | public function getLog() |
||
47 | { |
||
48 | return $this->log; |
||
50 | } |
||
51 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.