1 | <?php |
||
13 | class CommandException extends \RuntimeException implements GuzzleException |
||
14 | { |
||
15 | /** @var CommandInterface */ |
||
16 | private $command; |
||
17 | |||
18 | /** @var RequestInterface */ |
||
19 | private $request; |
||
20 | |||
21 | /** @var ResponseInterface */ |
||
22 | private $response; |
||
23 | |||
24 | /** |
||
25 | * @param CommandInterface $command |
||
26 | * @param \Exception $prev |
||
27 | * @return CommandException |
||
28 | */ |
||
29 | public static function fromPrevious(CommandInterface $command, \Exception $prev) |
||
59 | |||
60 | /** |
||
61 | * @param string $message Exception message |
||
62 | * @param CommandInterface $command |
||
63 | * @param \Exception $previous Previous exception (if any) |
||
64 | * @param RequestInterface $request |
||
65 | * @param ResponseInterface $response |
||
66 | */ |
||
67 | public function __construct( |
||
79 | |||
80 | /** |
||
81 | * Gets the command that failed. |
||
82 | * |
||
83 | * @return CommandInterface |
||
84 | */ |
||
85 | public function getCommand() |
||
89 | |||
90 | /** |
||
91 | * Gets the request that caused the exception |
||
92 | * |
||
93 | * @return RequestInterface|null |
||
94 | */ |
||
95 | public function getRequest() |
||
99 | |||
100 | /** |
||
101 | * Gets the associated response |
||
102 | * |
||
103 | * @return ResponseInterface|null |
||
104 | */ |
||
105 | public function getResponse() |
||
109 | } |
||
110 |
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.