Total Complexity | 8 |
Total Lines | 54 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
5 | class File |
||
6 | { |
||
7 | private $fname; |
||
8 | private $file; |
||
9 | |||
10 | 2 | public function __construct(string $fname = null) |
|
11 | { |
||
12 | 2 | $this->fname = $fname; |
|
13 | 2 | } |
|
14 | |||
15 | 2 | /** |
|
16 | * @return bool |
||
17 | */ |
||
18 | 2 | public function exists(): bool |
|
19 | { |
||
20 | 2 | if (file_exists($this->fname)) |
|
21 | 2 | return true; |
|
22 | 2 | ||
23 | return false; |
||
24 | 2 | } |
|
25 | |||
26 | 2 | /** |
|
27 | * @return bool|resource |
||
28 | 2 | */ |
|
29 | public function open() |
||
32 | 2 | } |
|
33 | |||
34 | public function create() |
||
35 | 2 | { |
|
36 | return $this->file = fopen($this->fname, 'w+'); |
||
37 | 2 | } |
|
38 | 2 | ||
39 | public function write(string $content): void |
||
43 | } |
||
44 | |||
45 | public function read(array $data): string |
||
54 | } |
||
55 | |||
56 | public function close(): void |
||
59 | } |
||
60 | } |
||
61 |