Total Complexity | 3 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class FileUtils |
||
10 | { |
||
11 | /** |
||
12 | * Adds a new $line at the end of a $file without duplication. |
||
13 | * |
||
14 | * @param string $file |
||
15 | * @param string $line |
||
16 | * |
||
17 | * @return bool|null |
||
18 | */ |
||
19 | public function addLine(string $file, string $line) |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * Counts the number of lines in a $file. |
||
26 | * |
||
27 | * @param string $file |
||
28 | * @param bool $countEmpty |
||
29 | * |
||
30 | * @return int|bool |
||
31 | */ |
||
32 | public function count(string $file, bool $countEmpty = false) |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Extracts the extension (without the dot) of a filename alone or contained in a path. |
||
39 | * |
||
40 | * @param string $filename |
||
41 | * |
||
42 | * @return string |
||
43 | */ |
||
44 | public function extractExtension(string $filename): string |
||
49 |