| Total Complexity | 10 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class File |
||
| 6 | { |
||
| 7 | private static ?File $instance = null; |
||
| 8 | |||
| 9 | static public function getInstance(): File |
||
| 10 | { |
||
| 11 | if (self::$instance === null) { |
||
| 12 | self::$instance = new self(); |
||
| 13 | } |
||
| 14 | |||
| 15 | return self::$instance; |
||
|
|
|||
| 16 | } |
||
| 17 | |||
| 18 | public function isDir($directory): bool |
||
| 19 | { |
||
| 20 | return is_dir($directory); |
||
| 21 | } |
||
| 22 | |||
| 23 | public function isFile($filename): bool |
||
| 24 | { |
||
| 25 | return is_file($filename); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function isLink($filename): bool |
||
| 31 | } |
||
| 32 | |||
| 33 | public function isReadable($filename): bool |
||
| 34 | { |
||
| 35 | return is_readable($filename); |
||
| 36 | } |
||
| 37 | |||
| 38 | public function getFilesize($filename): int |
||
| 41 | } |
||
| 42 | |||
| 43 | public function fileExists(string $path): bool |
||
| 44 | { |
||
| 46 | } |
||
| 47 | |||
| 48 | public function getContents(string $path, bool $asArray = false): string|false|array |
||
| 57 |