1 | <?php |
||
14 | class RedisShutdown implements ShutdownInterface |
||
15 | { |
||
16 | /** @var string */ |
||
17 | private $key; |
||
18 | |||
19 | /** @var \Predis\Client|\Redis */ |
||
20 | private $redis; |
||
21 | |||
22 | public function __construct($redis, string $key = 'hermes_shutdown') |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | * |
||
35 | * Returns true: |
||
36 | * |
||
37 | * - if shutdown timestamp is set, |
||
38 | * - and timestamp is not in future, |
||
39 | * - and hermes was started ($startTime) before timestamp |
||
40 | */ |
||
41 | public function shouldShutdown(DateTime $startTime): bool |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | * |
||
66 | * Sets to Redis value `$shutdownTime` (or current DateTime) to `$key` defined in constructor. |
||
67 | */ |
||
68 | public function shutdown(DateTime $shutdownTime = null): bool |
||
86 | } |
||
87 |
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.