1 | <?php |
||
2 | |||
3 | namespace BultonFr\Annotation\Parsers; |
||
4 | |||
5 | use BultonFr\Annotation\Annotations\AddNS; |
||
6 | |||
7 | /** |
||
8 | * Do action for annotation declared for all a class |
||
9 | * |
||
10 | * @package BultonFr\Annotation |
||
11 | */ |
||
12 | class ClassParser extends AbstractParser |
||
13 | { |
||
14 | /** |
||
15 | * {@inheritDoc} |
||
16 | * |
||
17 | * Use the annotation reader to obtain all Annotations\Info objects |
||
18 | * Create AddNS instancies and add there to ParserManager |
||
19 | * Instanciate all others annotations dedicated object |
||
20 | */ |
||
21 | public function run() |
||
22 | { |
||
23 | 1 | $this->execAnnotReader(); |
|
24 | 1 | $this->execAddNS(); |
|
25 | 1 | $this->generateAllAnnotObject($this->obtainItemName()); |
|
26 | 1 | } |
|
27 | |||
28 | /** |
||
29 | * Return the item name sent to AbstractAnnotation |
||
30 | * |
||
31 | * @return string |
||
32 | */ |
||
33 | protected function obtainItemName(): string |
||
34 | { |
||
35 | 1 | return 'class_'.$this->reflection->getName(); |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * Create AddNS's instancies and add the object to parserManager |
||
40 | * |
||
41 | * @return void |
||
42 | */ |
||
43 | protected function execAddNS() |
||
44 | { |
||
45 | 1 | $annotList = $this->annotReader->getAnnotationList(); |
|
0 ignored issues
–
show
|
|||
46 | |||
47 | 1 | if (array_key_exists('AddNS', $annotList) === false) { |
|
48 | return; |
||
49 | } |
||
50 | |||
51 | 1 | $nsList = $annotList['AddNS']; |
|
52 | 1 | foreach ($nsList as $infoObj) { |
|
53 | 1 | $ns = new AddNS( |
|
54 | 1 | $this->parserManager->getReader(), |
|
55 | 1 | $this->obtainItemName(), |
|
56 | $infoObj |
||
57 | ); |
||
58 | |||
59 | 1 | $this->parserManager->addImportedNS($ns->getNs(), $ns->getAlias()); |
|
60 | } |
||
61 | 1 | } |
|
62 | } |
||
63 |
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.