1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace SavinMikhail\CommentsDensity\AnalyzeComments\File; |
||
6 | |||
7 | use SplFileInfo; |
||
8 | |||
9 | use function count; |
||
10 | |||
11 | final readonly class FileTotalLinesCounter |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
12 | { |
||
13 | public function __construct( |
||
14 | private SplFileInfo $file, |
||
15 | ) {} |
||
16 | |||
17 | public function __invoke(): int |
||
18 | { |
||
19 | return count(file($this->file->getRealPath())); |
||
20 | } |
||
21 | } |
||
22 |