Skip to content

Support Laravel 6.0#24

Closed
motia wants to merge 7 commits intomaxbrokman:0.3from
motia:0.4
Closed

Support Laravel 6.0#24
motia wants to merge 7 commits intomaxbrokman:0.3from
motia:0.4

Conversation

@motia
Copy link

@motia motia commented Sep 30, 2019

Hi, I have updated the code to support laravel 6.

I did not find any major changes besides those of the constructors of the Worker and WorkerCommand base classes. So this PR has breaking changes to laravel 5 and it would be best to put it in a 0.4 branch.

Also, I had to swap the php-cs-fixer as the old version did not support php7 and was moved to another repository.

Thank you.

@coveralls
Copy link

coveralls commented Sep 30, 2019

Coverage Status

Coverage decreased (-3.5%) to 72.222% when pulling c431d7e on motia:0.4 into 21744ad on maxbrokman:0.3.

@sojeda
Copy link

sojeda commented Oct 16, 2019

Any update?

return new Worker($app['queue'], $app['events'],
$app['em'], $app['Illuminate\Contracts\Debug\ExceptionHandler']);
$isDownForMaintenance = function () {
return $app->isDownForMaintenance();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be return $this->app->isDownForMaintenance();

@Stolz Stolz mentioned this pull request Jan 7, 2020
@dpslwk
Copy link

dpslwk commented Jan 10, 2020

@maxbrokman could we get this merged please?

@kfeng0806
Copy link

kfeng0806 commented May 9, 2020

Hey @motia , i'm getting following error while using this PR

> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

In Container.php line 993:

  Unresolvable dependency resolving [Parameter #4 [ <required> callable $isDo
  wnForMaintenance ]] in class MaxBrokman\SafeQueue\Worker


Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

After disabled exception got null argument error

$ composer dumpautoload
Generating optimized autoload filesocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

In Worker.php line 33:

  Argument 5 passed to MaxBrokman\SafeQueue\Worker::__construct() must be cal
  lable, null given

Seems you can't pass callable function twice to parent::__construct() in MaxBrokman\SafeQueue\Worker line 40
It works when i changed the MaxBrokman\SafeQueue\Worker construct to

public function __construct(
        QueueManager $manager,
        Dispatcher $events,
        EntityManager $entityManager,
        ExceptionHandler $exceptions
    ) {
        $isDownForMaintenance = function () {
            return app()->isDownForMaintenance();
        };
        
        parent::__construct($manager, $events, $exceptions, $isDownForMaintenance);

        $this->entityManager = $entityManager;
}

@motia motia closed this Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants