Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
56 | public function deleteFilesOlderThanMinutes(int $minutes): Collection |
||
57 | { |
||
58 | $timeInPast = Carbon::now()->subMinutes($minutes); |
||
59 | |||
60 | return collect($this->filesystem->allFiles($this->directory)) |
||
61 | ->filter(function ($file) use ($timeInPast) { |
||
62 | return Carbon |
||
63 | ::createFromTimestamp($this->filesystem->lastModified($file)) |
||
64 | ->lt($timeInPast); |
||
65 | }) |
||
66 | ->each(function ($file) { |
||
67 | $this->filesystem->delete($file); |
||
68 | }); |
||
69 | } |
||
70 | } |
||
71 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..