Conditions | 2 |
Paths | 2 |
Total Lines | 24 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function handle() |
||
17 | { |
||
18 | $logDirectory = storage_path('logs'); |
||
19 | |||
20 | if (! $path = $this->findLatestLogFile($logDirectory)) { |
||
21 | $this->warn("Could not find a log file in `{$logDirectory}`."); |
||
22 | |||
23 | return; |
||
24 | } |
||
25 | |||
26 | $lines = $this->option('lines'); |
||
27 | |||
28 | $tailCommand = "tail -f -n {$lines} ".escapeshellarg($path); |
||
29 | |||
30 | $this->handleClearOption(); |
||
31 | |||
32 | (new Process($tailCommand)) |
||
33 | ->setTimeout(null) |
||
34 | ->run(function ($type, $line) { |
||
35 | $this->handleClearOption(); |
||
36 | |||
37 | $this->output->write($line); |
||
38 | }); |
||
39 | } |
||
40 | |||
68 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.