Skip to content

Commit

Permalink
[10.x] Do not use null to initialise $lastExecutionStartedAt (#46285)
Browse files Browse the repository at this point in the history
* Initialise $lastExecutionStartedAt with Carbon::now()

$lastExecutionStartedAt is passed to Carbon::equalTo(). Passing a null value to this method will result in deprecation message.

* Update ScheduleWorkCommand.php

---------

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
TimmayNL and taylorotwell authored Mar 1, 2023
1 parent e70ecfc commit 972e4db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Console/Scheduling/ScheduleWorkCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function handle()
$this->getLaravel()->isLocal() ? OutputInterface::VERBOSITY_NORMAL : OutputInterface::VERBOSITY_VERBOSE
);

[$lastExecutionStartedAt, $executions] = [null, []];
[$lastExecutionStartedAt, $executions] = [Carbon::now()->subMinutes(10), []];

$command = implode(' ', array_map(fn ($arg) => ProcessUtils::escapeArgument($arg), [
PHP_BINARY,
Expand Down

0 comments on commit 972e4db

Please sign in to comment.