Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creation of dynamic property $graceTimeInMinutes is deprecated #93

Closed
raray opened this issue Aug 21, 2023 · 9 comments · Fixed by #98
Closed

Creation of dynamic property $graceTimeInMinutes is deprecated #93

raray opened this issue Aug 21, 2023 · 9 comments · Fixed by #98
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@raray
Copy link

raray commented Aug 21, 2023

I'm getting thousands of these messages since upgrading to PHP8.2:

Creation of dynamic property Illuminate\Console\Scheduling\Event::$graceTimeInMinutes is deprecated in ...

I'm sorry that I don't really have much to offer other than our usage which is:

protected function schedule(Schedule $schedule)
    {
        $schedule->command('sendEmails')->everyMinute()->graceTimeInMinutes(10);
        $schedule->command('sendPartnerEmails')->everyMinute()->graceTimeInMinutes(45);
    }
@wivaku
Copy link

wivaku commented Aug 24, 2023

Same for e.g.

Creation of dynamic property Illuminate\Console\Scheduling\Event::$monitorName is deprecated in .../vendor/spatie/laravel-schedule-monitor/src/ScheduleMonitorServiceProvider.php on line 105

@freekmurze
Copy link
Member

I'd accept a PR that fixes this.

@freekmurze freekmurze added good first issue Good for newcomers help wanted Extra attention is needed labels Aug 25, 2023
@akiyamaSM
Copy link

You need to upgrade the Laravel version to support 8.2. on my side the package worked for me under PHP 8.2.

@codetroll
Copy link

I upgraded to 8.2 - that didn't help. Besides - the requirement for laravel 10 states PHP 8.1/8.2 so some kind of workaround should probably be made for 8.1

@heikokrebs
Copy link

heikokrebs commented Jan 22, 2024

I still get this errors, despite the fix in #98 after upgrading to php 8.2
The properties are now declared at the ScheduleMonitorServiceProvider class but not on the Event and Callback classes - and cant be 🤔

Creation of dynamic property Illuminate\Console\Scheduling\Event::$monitorName is deprecated in …vendor/spatie/laravel-schedule-monitor/src/ScheduleMonitorServiceProvider.php on line 113

Creation of dynamic property Illuminate\Console\Scheduling\CallbackEvent::$monitorName is deprecated in …vendor/spatie/laravel-schedule-monitor/src/ScheduleMonitorServiceProvider.php on line 113

As stated here https://www.php.net/manual/en/migration82.deprecated.php:

The creation of dynamic properties is deprecated, unless the class opts in by using the #[\AllowDynamicProperties] attribute.

Both Illuminate\Console\Scheduling\Event and Illuminate\Console\Scheduling\CallbackEvent do not support this right now.
So this cant be fixed within the scope of this package? 🤔

@exophunk
Copy link

For me the same deprecation errors also still show up. The issue seems not to be fixed and maybe needs to be reopened? Maybe there is another mechanism how to add grace time or monitor name?

@heikokrebs
Copy link

@freekmurze do you have the opportunity to take another look here?

@freekmurze
Copy link
Member

Currently short on time, if it's urgent, please submit a PR 👍

@heikokrebs
Copy link

@freekmurze unfortunately, i have no idea what a fix could look like. But I would like to use Oh Dear in this way with our account. Any idea/direction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants