| Total Complexity | 7 |
| Total Lines | 73 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class FileSystem |
||
| 9 | { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @var Flow |
||
| 13 | */ |
||
| 14 | protected $flow; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string[] |
||
| 18 | */ |
||
| 19 | protected $paths = []; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | protected $path; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * FileSystem constructor. |
||
| 28 | * |
||
| 29 | * @param Flow $flow |
||
| 30 | * @param string $path |
||
| 31 | */ |
||
| 32 | 20 | public function __construct(Flow $flow, string $path) |
|
| 36 | 20 | } |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @param string $view |
||
| 40 | * |
||
| 41 | * @return bool |
||
| 42 | */ |
||
| 43 | 20 | public function has(string $view): bool |
|
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @param string $view |
||
| 61 | * @param string $data |
||
| 62 | */ |
||
| 63 | 19 | public function set(string $view, string $data) |
|
| 64 | { |
||
| 65 | 19 | $this->paths[$view] = true; |
|
| 66 | |||
| 67 | 19 | \file_put_contents( |
|
| 68 | 19 | $this->get($view), |
|
| 69 | 19 | $data |
|
| 70 | ); |
||
| 71 | 19 | } |
|
| 72 | |||
| 73 | /** |
||
| 74 | * @param string $view |
||
| 75 | * |
||
| 76 | * @return string |
||
| 77 | */ |
||
| 78 | 20 | public function get(string $view): string |
|
| 81 | } |
||
| 82 | |||
| 84 |