1 | <?php |
||
21 | class RetryCommand extends Command |
||
22 | { |
||
23 | /** |
||
24 | * @var JobQueue |
||
25 | */ |
||
26 | protected $queue; |
||
27 | |||
28 | /** |
||
29 | * @var FailedJobProviderInterface |
||
30 | */ |
||
31 | protected $failer; |
||
32 | |||
33 | /** |
||
34 | * RetryCommand constructor. |
||
35 | * |
||
36 | * @param JobQueue $queue |
||
37 | * @param FailedJobProviderInterface $failer |
||
38 | */ |
||
39 | public function __construct(JobQueue $queue, FailedJobProviderInterface $failer) |
||
46 | |||
47 | /** |
||
48 | * Configure command |
||
49 | */ |
||
50 | protected function configure() |
||
56 | |||
57 | /** |
||
58 | * Execute command |
||
59 | * |
||
60 | * @param InputInterface $input |
||
61 | * @param OutputInterface $output |
||
62 | * |
||
63 | * @return int|void|null |
||
64 | */ |
||
65 | public function execute(InputInterface $input, OutputInterface $output) |
||
90 | |||
91 | /** |
||
92 | * Retry job |
||
93 | * |
||
94 | * @param Job $job |
||
95 | * |
||
96 | * @return bool |
||
97 | */ |
||
98 | protected function retryJob(Job $job): bool |
||
111 | } |
||
112 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.