amteich / kirby-twig

Twig templating support for Kirby CMS
MIT License
48 stars 12 forks source link

Dirname should not get null parameter in PHP 8.1 #25

Closed ersoma closed 2 years ago

ersoma commented 2 years ago

Since PHP 8.1 passing null to non-nullable internal function parameters is deprecated (https://php.watch/versions/8.1/internal-func-non-nullable-null-deprecation). PHP 8.1 is already stable and Kirby supports it, so when I tried to update I came across the exception thrown from this plugin.

In the Template.php file's constructor, the dirname function's parameter comes from the file() function which can return null. An added null-check can prevent this.

ceesvanegmond commented 2 years ago

@seehat Could you please merge and tag this?

seehat commented 2 years ago

Yes, I will merge this today. I was busy the last days. Sry.

ceesvanegmond commented 2 years ago

@seehat Np! Thanks! We would really like to use PHP8.1 with this awesome package :-)

seehat commented 2 years ago

Does ist work now @ersoma and @ceesvanegmond?

ceesvanegmond commented 2 years ago

@seehat Works! Thanks!

ersoma commented 2 years ago

@seehat Works here as well, thanks!