1 | <?php |
||||
2 | |||||
3 | namespace Maestriam\Samurai\Foundation; |
||||
4 | |||||
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 |
||||
0 ignored issues
–
show
|
|||||
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); |
||||
0 ignored issues
–
show
The method
dir() does not exist on Maestriam\Samurai\Foundation\ThemeSearch .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||
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(); |
||||
0 ignored issues
–
show
The method
build() does not exist on Maestriam\Samurai\Foundation\ThemeSearch .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||
46 | } |
||||
47 | |||||
48 | return $this->get(); |
||||
0 ignored issues
–
show
|
|||||
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 |
||||
58 | { |
||||
59 | if (! $this->exists()) { |
||||
60 | return null; |
||||
61 | } |
||||
62 | |||||
63 | return $this; |
||||
0 ignored issues
–
show
|
|||||
64 | } |
||||
65 | } |
||||
66 |
This check looks for private methods that have been defined, but are not used inside the class.