Skip to content

Commit

Permalink
Merge pull request #78 from martijngastkemper/optional-parameter-foll…
Browse files Browse the repository at this point in the history
…ows-required

Fix PHP 8 error in Template.php
  • Loading branch information
toonvandenbos authored Mar 5, 2021
2 parents 26f52be + c0029fe commit 7c702d2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Pages/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,11 @@ public function setDate($moment, $date = null)
* @param Closure $closure
* @return mixed
*/
public function setDateIf($moment, $date = null, Closure $closure)
public function setDateIf($moment, $date, Closure $closure)
{
if(!($date instanceof Carbon)) {
$date = new Carbon($date);
}

if($closure($date, $this->getDate($moment))) {
return $this->setDate($moment, $date);
}
Expand Down

0 comments on commit 7c702d2

Please sign in to comment.