1 | <?php |
||
13 | final class Command |
||
14 | { |
||
15 | /** @var CommandStartedEvent */ |
||
16 | private $startedEvent; |
||
17 | |||
18 | /** @var CommandSucceededEvent|CommandFailedEvent */ |
||
19 | private $finishedEvent; |
||
20 | |||
21 | 28 | private function __construct() |
|
24 | |||
25 | 28 | public static function createForSucceededCommand(CommandStartedEvent $startedEvent, CommandSucceededEvent $succeededEvent): self |
|
35 | |||
36 | public static function createForFailedCommand(CommandStartedEvent $startedEvent, CommandFailedEvent $failedEvent): self |
||
46 | |||
47 | /** |
||
48 | * @param CommandSucceededEvent|CommandFailedEvent $finishedEvent |
||
49 | */ |
||
50 | 28 | private static function checkRequestIds(CommandStartedEvent $startedEvent, $finishedEvent): void |
|
56 | |||
57 | 4 | public function getCommandName(): string |
|
61 | |||
62 | 4 | public function getCommand(): object |
|
66 | |||
67 | public function getDurationMicros(): int |
||
71 | |||
72 | public function getRequestId(): string |
||
76 | |||
77 | public function getServer(): Server |
||
81 | |||
82 | public function getReply(): object |
||
86 | |||
87 | public function getError(): ?\Throwable |
||
91 | } |
||
92 |
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.