1 | <?php |
||
11 | class SwaggerContext extends BaseContext |
||
12 | { |
||
13 | use SymfonyAssertsTrait; |
||
14 | |||
15 | /** @var ValidatorMap */ |
||
16 | private $map; |
||
17 | |||
18 | public function __construct(ValidatorMap $map) |
||
22 | |||
23 | /** |
||
24 | * This method match the response against its Swagger definition. |
||
25 | * |
||
26 | * @throws \Behat\Mink\Exception\ExpectationException |
||
27 | * @throws \Exception |
||
28 | * |
||
29 | * @Then the response should match the Swagger definition |
||
30 | */ |
||
31 | public function theResponseMatchSwagger() |
||
39 | |||
40 | /** |
||
41 | * @return \Symfony\Component\BrowserKit\Client |
||
42 | * |
||
43 | * @throws UnsupportedDriverActionException |
||
44 | */ |
||
45 | protected function getClient() |
||
55 | |||
56 | /** |
||
57 | * Get the last response. |
||
58 | * |
||
59 | * @return \Symfony\Component\HttpFoundation\Response |
||
60 | */ |
||
61 | protected function getResponse() |
||
65 | |||
66 | /** |
||
67 | * @return \Symfony\Component\HttpFoundation\Request |
||
68 | */ |
||
69 | public function getRequest() |
||
73 | } |
||
74 |
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.