laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.64k stars 11.04k forks source link

Schedule grouping PHPstan issue #53548

Closed rcerljenko closed 4 days ago

rcerljenko commented 4 days ago

Laravel Version

11.32.0

PHP Version

8.3

Database Driver & Version

No response

Description

PHPstan has issues with the latest "Schedule grouping" feature:

Call to an undefined static method Illuminate\Support\Facades\Schedule::onOneServer(). 

It errors the same with the rest of the group functions such as runInBackground, withoutOverlapping, etc.

Possible solution could be to add these method signatures in the facade docblock?

Illuminate\Support\Facades\Schedule.php

Steps To Reproduce

<?php

// routes/console.php

use Illuminate\Support\Facades\Schedule;
use Illuminate\Console\Scheduling\Schedule as ConsoleSchedule;

Schedule::onOneServer()
    ->runInBackground()
    ->withoutOverlapping()
    ->group(static function (ConsoleSchedule $schedule): void {
        // Schedule definitions
    });
crynobone commented 4 days ago

Hey there, thanks for reporting this issue.

If you notice improper DocBlock, PHPStan, or IDE warnings while using Laravel, do not create a GitHub issue. Instead, please submit a pull request to fix the problem. Also see our contribution guide.

Thanks!

timacdonald commented 4 days ago

This will be fixed shortly.

https://github.com/laravel/framework/pull/53550

rcerljenko commented 4 days ago

This will be fixed shortly.

53550

thanks!