Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Mick79's avatar

Weird scheduling bug

I'm trying and struggling to get scheduling working.

in kernel.php I have added this

  protected function schedule(Schedule $schedule)
    {

$schedule->job(SendText::send_sms($phonenumber, $message))
            ->everyMinute();
    }

on deploy this causes this build error

In Schedule.php line 106:
get_class() expects parameter 1 to be object, null given  

If I take away that $schedule->job then it deploys fine. Even more bizarrely - I can't find a "Schedule.php" anywhere in my app.

Please help me understand this.

0 likes
2 replies
Mick79's avatar

I think the problem is that the method I'm calling doesn't return anything. It's a void.

Mick79's avatar
Mick79
OP
Best Answer
Level 5

I just added

return "true"

and now it all deploys and works fine......

Please or to participate in this conversation.