whitecube / nova-page

Static pages content management for Laravel Nova
https://whitecube.github.io/nova-page
MIT License
238 stars 41 forks source link

PHP 8 Compatibility? -- Required parameter follows optional parameter #84

Closed colinxr closed 2 years ago

colinxr commented 2 years ago

I've been trying to use Laravel Shift to generate some testing infrastructure (factories, http tests, etc). I keep running into an issue because of the nova-page package.

[2021-10-26 01:03:46] shift.ERROR: Required parameter $closure follows optional parameter $date at /opt/shift/tmp/20211026010244/exsiteincteam/well-traveled/vendor/whitecube/nova-page/src/Pages/Template.php:349

the related code is here

 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);
        }
    }

Could I take a look and submit a pull request on this?

toonvandenbos commented 2 years ago

Hi @colinxr, yes please go ahead, of course you can make a PR for this ! I'm sorry we're not very active lately, we're quite overwhelmed with client work...

colinxr commented 2 years ago

Hey @Nyratas, Going to close this issue! I was mistakenly on an older version of Nova Page! I thought I had upgraded, but apparently had not. The problem was resolved after upgrading.

Cheers