Total Complexity | 9 |
Total Lines | 63 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class Directory extends Storable |
||
12 | { |
||
13 | /** |
||
14 | * Instância um diretório |
||
15 | * @param string $path Caminho relativo |
||
16 | */ |
||
17 | public function __construct($path) |
||
18 | { |
||
19 | $this->setPath($path); |
||
20 | } |
||
21 | |||
22 | /** @return bool */ |
||
23 | public function exists() |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @param string $path Caminho relativo |
||
30 | * @throws Exception |
||
31 | */ |
||
32 | protected function setPath($path) |
||
33 | { |
||
34 | if (!preg_match(static::REGEXP_PATH, $path . static::DS)) { |
||
35 | throw new Exception($path . ' is a invalid directory path.'); |
||
36 | } |
||
37 | parent::setPath($path); |
||
38 | } |
||
39 | |||
40 | /** @return bool */ |
||
41 | public function isEmpty() |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * Retorna nome dos itens dentro do diretório (em ordem alfabética) |
||
48 | * @return string[] |
||
49 | */ |
||
50 | public function getChildrenNames() |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Retorna os itens dentro do diretório (em ordem alfabética) |
||
59 | * @return Storable[] |
||
60 | */ |
||
61 | public function getChildren() |
||
76 |