| Total Complexity | 4 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class File |
||
| 6 | { |
||
| 7 | private $name; |
||
| 8 | private $file; |
||
| 9 | |||
| 10 | 2 | public function create(string $name) |
|
| 11 | { |
||
| 12 | 2 | $this->name = $name; |
|
| 13 | 2 | $this->file = fopen($name, 'w+'); |
|
| 14 | |||
| 15 | 2 | return $this->file; |
|
| 16 | } |
||
| 17 | |||
| 18 | 2 | public function write(string $content): void |
|
| 22 | 2 | } |
|
| 23 | |||
| 24 | 2 | public function read(array $data): string |
|
| 25 | { |
||
| 26 | 2 | extract($data); |
|
| 27 | |||
| 28 | 2 | ob_start(); |
|
| 29 | |||
| 30 | 2 | include $this->name; |
|
| 31 | |||
| 32 | 2 | return ob_get_clean(); |
|
| 33 | } |
||
| 34 | |||
| 35 | 2 | public function close(): void |
|
| 38 | 2 | } |
|
| 39 | } |
||
| 40 |