Conditions | 2 |
Paths | 2 |
Total Lines | 22 |
Code Lines | 12 |
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 | $this->info("start tailing {$path}"); |
||
29 | |||
30 | $tailCommand = "tail -f -n {$lines} " . escapeshellarg($path); |
||
31 | |||
32 | (new Process($tailCommand)) |
||
33 | ->setTimeout(null) |
||
34 | ->run(function ($type, $line) { |
||
35 | $this->output->write($line); |
||
36 | }); |
||
37 | } |
||
38 | |||
59 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.