ekdahl / webtrees-github-theme

A theme for webtrees, inspired by the GitHub website
2 stars 0 forks source link

Not working for PHP 7.4 due to union types #1

Closed raaspt closed 2 weeks ago

raaspt commented 2 weeks ago

This webtrees module is currently not compatible with PHP 7.4 as it's using union type "Tree|null" in the "userMenu" function which were introduced in PHP 8.0. Please consider using "?Tree" instead. Thanks.

Fatal error in module: webtrees-github-theme ParseError: syntax error, unexpected '|', expecting variable (T_VARIABLE) in /volume1/web/family/modules_v4/webtrees-github-theme/GitHubTheme.php:72

callmeahmedr commented 2 weeks ago

Just open a PR for this issue with the repository owner you can quickly fix this before the PR is merged by modifying the following:

Open GitHubTheme.php, go to Line 72

Change this line public function userMenu(Tree|null $tree): array

to this: public function userMenu(?Tree $tree): array

This change will ensure compatibility with PHP 7.4

Have an awesome day!

ekdahl commented 2 weeks ago

Fixed in 1382ab6a68677a41593fc4c4ead11e058c7b4921