Total Complexity | 5 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class Filesystem implements FilesystemInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var \drupol\phpvfs\Node\DirectoryInterface |
||
17 | */ |
||
18 | private $cwd; |
||
19 | |||
20 | /** |
||
21 | * Filesystem constructor. |
||
22 | * |
||
23 | * @param \drupol\phpvfs\Node\DirectoryInterface $directory |
||
24 | */ |
||
25 | 16 | public function __construct(DirectoryInterface $directory) |
|
26 | { |
||
27 | 16 | $this->cwd = $directory; |
|
28 | 16 | } |
|
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | 14 | public function getCwd(): DirectoryInterface |
|
34 | { |
||
35 | 14 | return $this->cwd; |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * @return string |
||
40 | */ |
||
41 | 4 | public function pwd(): string |
|
42 | { |
||
43 | 4 | return $this->getCwd()->getPath()->__toString(); |
|
44 | } |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | 2 | public function root(): FilesystemNodeInterface |
|
50 | { |
||
51 | 2 | return $this->getCwd()->root(); |
|
52 | } |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 2 | public function setCwd(DirectoryInterface $dir) |
|
62 | } |
||
63 | } |
||
64 |