Total Complexity | 7 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class ThemeSearch |
||
6 | { |
||
7 | |||
8 | |||
9 | /** |
||
10 | * Retorna uma instância de uma diretiva de acordo |
||
11 | * com os dados do nome, do tipo e do tema a qual pertence |
||
12 | * |
||
13 | * @param string $name Nome da diretiva |
||
14 | * @param string $type Tipo que pertence |
||
15 | * @return Directive |
||
16 | */ |
||
17 | private function directivefy(string $name, string $type) : Directive |
||
|
|||
18 | { |
||
19 | return new Directive($name, $type, $this); |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * Retorna se existe o diretório do tema |
||
24 | * na base de temas |
||
25 | * |
||
26 | * @param string $name Nome do tema |
||
27 | * @return boolean |
||
28 | */ |
||
29 | public function exists() : bool |
||
30 | { |
||
31 | $theme = $this->dir()->theme($this->distributor, $this->name); |
||
32 | |||
33 | return (is_dir($theme)) ? true : false; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Tenta encontrar um tema questão |
||
38 | * Caso não encontre, constua-o |
||
39 | * |
||
40 | * @return Theme |
||
41 | */ |
||
42 | public function findOrBuild() : Theme |
||
43 | { |
||
44 | if (! $this->exists()) { |
||
45 | return $this->build(); |
||
46 | } |
||
47 | |||
48 | return $this->get(); |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * Retorna a instância de um tema |
||
53 | * se caso o tema existir |
||
54 | * |
||
55 | * @return Theme|null |
||
56 | */ |
||
57 | public function get() : ?Theme |
||
64 | } |
||
65 | } |
||
66 |
This check looks for private methods that have been defined, but are not used inside the class.