Conditions | 4 |
Paths | 6 |
Total Lines | 22 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | public function index() |
||
20 | { |
||
21 | |||
22 | if (Request::input('l')) { |
||
23 | LaravelLogViewer::setFile(base64_decode(Request::input('l'))); |
||
24 | } |
||
25 | |||
26 | if (Request::input('dl')) { |
||
27 | return Response::download(LaravelLogViewer::pathToLogFile(base64_decode(Request::input('dl')))); |
||
28 | } elseif (Request::has('del')) { |
||
29 | File::delete(LaravelLogViewer::pathToLogFile(base64_decode(Request::input('del')))); |
||
30 | return $this->redirect(Request::url()); |
||
31 | } |
||
32 | |||
33 | $logs = LaravelLogViewer::all(); |
||
34 | |||
35 | return View::make('laravel-log-viewer::log', [ |
||
36 | 'logs' => $logs, |
||
37 | 'files' => LaravelLogViewer::getFiles(true), |
||
38 | 'current_file' => LaravelLogViewer::getFileName() |
||
39 | ]); |
||
40 | } |
||
41 | |||
51 |
This check looks for classes that have been defined more than once in the same file.
If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.
This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.