laravel-queue-rabbitmq: PHP Fatal error: Declaration of VladimirYuldashev\LaravelQueueRabbitMQ\Consumer::stop($status = 0): int must be compatible with Illuminate\Queue\Worker::stop($status = 0, $options = null)
I used command:
composer update at laravel version 9.42
log:
`PHP Fatal error: Declaration of VladimirYuldashev\LaravelQueueRabbitMQ\Consumer::stop($status = 0): int must be compatible with Illuminate\Queue\Worker::stop($status = 0, $options = null) in /home/gabriel/Projekty/subjects_and_grades/vendor/vladimir-yuldashev/laravel-queue-rabbitmq/src/Consumer.php on line 200
Symfony\Component\ErrorHandler\Error\FatalError
Declaration of VladimirYuldashev\LaravelQueueRabbitMQ\Consumer::stop($status = 0): int must be compatible with Illuminate\Queue\Worker::stop($status = 0, $options = null)
at vendor/vladimir-yuldashev/laravel-queue-rabbitmq/src/Consumer.php:200 196▕ * 197▕ * @param int $status 198▕ * @return int 199▕ */ ➜ 200▕ public function stop($status = 0): int 201▕ { 202▕ // Tell the server you are going to stop consuming. 203▕ // It will finish up the last message and not send you any more. 204▕ $this->channel->basic_cancel($this->consumerTag, false, true);
Whoops\Exception\ErrorException
Declaration of VladimirYuldashev\LaravelQueueRabbitMQ\Consumer::stop($status = 0): int must be compatible with Illuminate\Queue\Worker::stop($status = 0, $options = null)
at vendor/vladimir-yuldashev/laravel-queue-rabbitmq/src/Consumer.php:200 196▕ * 197▕ * @param int $status 198▕ * @return int 199▕ */ ➜ 200▕ public function stop($status = 0): int 201▕ { 202▕ // Tell the server you are going to stop consuming. 203▕ // It will finish up the last message and not send you any more. 204▕ $this->channel->basic_cancel($this->consumerTag, false, true);
+1 vendor frames
2 [internal]:0 Whoops\Run::handleShutdown() Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255 `
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 12
- Comments: 24
Commits related to this issue
- Fix consumer compatibility with laravel v9.42.0 (#499) — committed to Arthur-Sk/laravel-queue-rabbitmq by deleted user 2 years ago
- Fix local #499 #501 — committed to shuqingzai/laravel-queue-rabbitmq by shuqingzai 2 years ago
- Fix local #499 — committed to shuqingzai/laravel-queue-rabbitmq by shuqingzai 2 years ago
- Fix local #499 — committed to shuqingzai/laravel-queue-rabbitmq by shuqingzai 2 years ago
- Fix local #499 - laravel 9.42 — committed to shuqingzai/laravel-queue-rabbitmq by shuqingzai 2 years ago
- Fix method declaration compatibility (#499) Issue: https://github.com/vyuldashev/laravel-queue-rabbitmq/issues/499 Fix from: https://github.com/vyuldashev/laravel-queue-rabbitmq/pull/502 — committed to jeromegamez/vyuldashev-laravel-queue-rabbitmq by jeromegamez a year ago
- code style #449 #499 #501 — committed to shuqingzai/laravel-queue-rabbitmq by shuqingzai a year ago
- Merge pull request #502 from shuqingzai/dev-13.0.1 fix #449 #499 #501 — committed to vyuldashev/laravel-queue-rabbitmq by M-Porter a year ago
- Fix method declaration compatibility (#499) Issue: https://github.com/vyuldashev/laravel-queue-rabbitmq/issues/499 Fix from: https://github.com/vyuldashev/laravel-queue-rabbitmq/pull/502 — committed to jeromegamez/vyuldashev-laravel-queue-rabbitmq by jeromegamez a year ago
@devzorg thank you!
I will add little more details to your temporary solution to fix problem:
Copy
vendor/vladimir-yuldashev/laravel-queue-rabbitmq/src/Consumer.phpclass to custom place. In my example is:composer-overrides/vyuldashev/laravel-queue-rabbitmq/Consumer.php.Make signature and implementation compatible to parent in copied class:
autoloadsection at rootcomposer.json: exclude package’sConsumerclass from classmap. Next, add overriden class instead of themcomposer dumpThis solution tested with
php artisan queue:workcommand@heylucasf, just run the
composer require laravel/framework:9.41console command.Hi, new maintainers were recently added and we are getting up to speed with going through issues and getting the library compatible again!
Is the pull request going live soon ?
any update?
we have to use laravel 9.41 and cannot have the last laravel updated version because of this issue
doesn’t work with “laravel/framework”: “^9.19”,
Add to composer.json, the below line. It will downgrade the worker to be compatible with the package, then once they fix the issue, remove it.
"illuminate/queue": "9.41.0",@vyuldashev it would be nice if you can review and merge one of the pull requests associated with this issue.
Worked, thanks.