| 1 | <?php  | 
            ||
| 8 | abstract class BaseController  | 
            ||
| 9 | { | 
            ||
| 10 | const API_VERSION = '17.05';  | 
            ||
| 11 | |||
| 12 | protected $logger;  | 
            ||
| 13 | |||
| 14 | protected $database;  | 
            ||
| 15 | |||
| 16 | protected $request;  | 
            ||
| 17 | |||
| 18 | protected $response;  | 
            ||
| 19 | |||
| 20 | protected $args;  | 
            ||
| 21 | |||
| 22 | /**  | 
            ||
| 23 | * @param Request $request  | 
            ||
| 24 | * @param Response $response  | 
            ||
| 25 | * @param array $args  | 
            ||
| 26 | */  | 
            ||
| 27 | protected function setParams($request, $response, $args)  | 
            ||
| 34 | |||
| 35 | /**  | 
            ||
| 36 | * Send response with json as standard format.  | 
            ||
| 37 | *  | 
            ||
| 38 | * @param string $status  | 
            ||
| 39 | * @param mixed $message  | 
            ||
| 40 | * @param int $code  | 
            ||
| 41 | * @return array $response  | 
            ||
| 42 | */  | 
            ||
| 43 | protected function jsonResponse($status, $message, $code)  | 
            ||
| 54 | |||
| 55 | /**  | 
            ||
| 56 | * Log each request.  | 
            ||
| 57 | */  | 
            ||
| 58 | protected function logRequest()  | 
            ||
| 68 | |||
| 69 | /**  | 
            ||
| 70 | * Log each response.  | 
            ||
| 71 | *  | 
            ||
| 72 | * @param array $response  | 
            ||
| 73 | */  | 
            ||
| 74 | protected function logResponse($response)  | 
            ||
| 79 | }  | 
            ||
| 80 | 
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.