1 | <?php |
||
23 | class BaseController extends Controller |
||
24 | { |
||
25 | |||
26 | use ValidatesRequests; |
||
27 | |||
28 | /** |
||
29 | * 后台入口页(控制台) |
||
30 | * |
||
31 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
||
32 | */ |
||
33 | public function index() |
||
37 | |||
38 | /** |
||
39 | * 后台视图输出 |
||
40 | * |
||
41 | * @param string $view |
||
42 | * @param array $params |
||
43 | * |
||
44 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
||
45 | */ |
||
46 | protected function render($view, $params = []) |
||
50 | |||
51 | |||
52 | /** |
||
53 | * 重构验证响应方法(主要针对ajax|json) |
||
54 | * |
||
55 | * @param \Illuminate\Http\Request $request |
||
56 | * @param array $errors |
||
57 | * |
||
58 | * @return \Illuminate\Http\JsonResponse |
||
59 | */ |
||
60 | /*protected function buildFailedValidationResponse(Request $request, array $errors) |
||
|
|||
61 | { |
||
62 | if (($request->ajax() && !$request->pjax()) || $request->wantsJson()) { |
||
63 | $error = array_shift($errors); |
||
64 | $error = is_array($error) ? current($error) : $error; |
||
65 | return new JsonResponse(error($error)); |
||
66 | } |
||
67 | return parent::buildFailedValidationResponse($request, $errors); |
||
68 | }*/ |
||
69 | } |
||
70 |
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.