Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function check(array $config): bool |
||
34 | { |
||
35 | $this->ignoreFiles = new Collection(array_get($config, 'ignore_files', [])); |
||
36 | |||
37 | $logHandlers = Collection::make(app('log')->driver()->getLogger()->getHandlers()); |
||
38 | $fileInfo = pathinfo($logHandlers->first()->getUrl()); |
||
39 | $globPattern = Str::finish($fileInfo['dirname'], '/*.' . $fileInfo['extension']); |
||
40 | $this->logFiles = Collection::make(glob($globPattern))->reject(function ($file) { |
||
41 | return Str::is($this->ignoreFiles->toArray(), pathinfo($file, PATHINFO_BASENAME)); |
||
42 | }); |
||
43 | |||
44 | return $this->logFiles->isEmpty(); |
||
45 | } |
||
46 | |||
60 |