1 | <?php |
||
12 | class TextApiResponse implements ResponseInterface |
||
13 | { |
||
14 | use SmartObject; |
||
15 | |||
16 | /** @var int */ |
||
17 | private $code; |
||
18 | |||
19 | /** @var mixed */ |
||
20 | private $data; |
||
21 | |||
22 | /** |
||
23 | * @param int $code |
||
24 | * @param mixed $data |
||
25 | */ |
||
26 | 6 | public function __construct(int $code, $data) |
|
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | 3 | public function getCode(): int |
|
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | 3 | public function send(IRequest $httpRequest, IResponse $httpResponse): void |
|
51 | } |
||
52 |
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.