1 | <?php |
||
20 | abstract class AbstractProxy |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * Indent for source code |
||
25 | * |
||
26 | * @var int |
||
27 | */ |
||
28 | protected $indent = 4; |
||
29 | |||
30 | /** |
||
31 | * List of advices that are used for generation of child |
||
32 | * |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $advices = []; |
||
36 | |||
37 | /** |
||
38 | * PHP expression string for accessing LSB information |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | protected static $staticLsbExpression = 'static::class'; |
||
43 | |||
44 | /** |
||
45 | * Should proxy use variadics support or not |
||
46 | * |
||
47 | * @var bool |
||
48 | */ |
||
49 | protected $useVariadics = false; |
||
50 | |||
51 | /** |
||
52 | * Constructs an abstract proxy class |
||
53 | * |
||
54 | * @param array $advices List of advices |
||
55 | * @param bool $useVariadics Should proxy use variadics syntax or not |
||
56 | */ |
||
57 | public function __construct(array $advices = [], $useVariadics = false) |
||
58 | { |
||
59 | $this->advices = $this->flattenAdvices($advices); |
||
60 | $this->useVariadics = $useVariadics; |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * Returns text representation of class |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | abstract public function __toString(); |
||
69 | |||
70 | /** |
||
71 | * Indent block of code |
||
72 | * |
||
73 | * @param string $text Non-indented text |
||
74 | * |
||
75 | * @return string Indented text |
||
76 | */ |
||
77 | protected function indent($text) |
||
86 | |||
87 | /** |
||
88 | * Returns list of string representation of parameters |
||
89 | * |
||
90 | * @param array|Parameter[]|ParsedParameter[] $parameters List of parameters |
||
91 | * |
||
92 | * @return array |
||
93 | */ |
||
94 | protected function getParameters(array $parameters) |
||
107 | |||
108 | /** |
||
109 | * Return string representation of parameter |
||
110 | * |
||
111 | * @param Parameter|ParsedParameter $parameter Reflection parameter |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | protected function getParameterCode($parameter) |
||
147 | |||
148 | /** |
||
149 | * Replace concrete advices with list of ids |
||
150 | * |
||
151 | * @param $advices |
||
152 | * |
||
153 | * @return array flatten list of advices |
||
154 | */ |
||
155 | private function flattenAdvices($advices) |
||
168 | |||
169 | /** |
||
170 | * Prepares a line with args from the method definition |
||
171 | * |
||
172 | * @param ParsedMethod $method |
||
173 | * |
||
174 | * @return string |
||
175 | */ |
||
176 | protected function prepareArgsLine(ParsedMethod $method) |
||
186 | } |
||
187 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.