Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
do not fail when shortSchedule is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed May 16, 2024
1 parent 629924e commit 5d18a8d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ShortSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Support\Traits\Macroable;
use React\EventLoop\LoopInterface;
use ReflectionClass;
use ReflectionException;

class ShortSchedule
{
Expand Down Expand Up @@ -53,7 +54,12 @@ public function registerCommandsFromConsoleKernel(): self

$class = new ReflectionClass(get_class($kernel));

$shortScheduleMethod = $class->getMethod('shortSchedule');
try {
$shortScheduleMethod = $class->getMethod('shortSchedule');
} catch (ReflectionException) {
// The application does not have a shortSchedule method
return $this;
}

$shortScheduleMethod->setAccessible(true);

Expand Down

0 comments on commit 5d18a8d

Please sign in to comment.