Current Behavior
Latest version of extension doesn't work on PHP 7.4
PHP Fatal error: Uncaught TypeError: Argument 2 passed to FoF\DefaultUserPreferences\Extend\RegisterUserPreferenceDefault::default() must be an instance of FoF\DefaultUserPreferences\Extend\mixed, int given, called in /home/odieshos/domain.com/vendor/fof/nightmode/extend.php on line 61 and defined in /home/odieshos/domain.com/vendor/fof/default-user-preferences/src/Extend/RegisterUserPreferenceDefault.php:33
Steps to Reproduce
Try using with PHP <8.0
Probably needs one of the other extension that provide integration, like the latest version of fof/nightmode
Expected Behavior
Extension should support PHP 7.3 and 7.4 or define an explicit 8.0 requirement.
Bug Report
Current Behavior Latest version of extension doesn't work on PHP 7.4
Steps to Reproduce Try using with PHP <8.0 Probably needs one of the other extension that provide integration, like the latest version of
fof/nightmode
Expected Behavior Extension should support PHP 7.3 and 7.4 or define an explicit 8.0 requirement.
Environment
Possible solution(s)
mixed
typing isn't available before PHP 8.0It seems to be used in 2 different places in the extension, introduced in #3
https://github.com/FriendsOfFlarum/default-user-preferences/blob/310d4d92b9197cee83b81d4d57524d17b702ba0a/src/Extend/RegisterUserPreferenceDefault.php#L33
https://github.com/FriendsOfFlarum/default-user-preferences/blob/310d4d92b9197cee83b81d4d57524d17b702ba0a/src/Listeners/ApplyDefaultPreferences.php#L47
Additional Context Reported at https://discuss.flarum.org/d/31088-an-error-about-fof-night-mode
Something similar was just fixed in core by luceos. Coincidence? https://github.com/flarum/framework/commit/9532b71312977c9f8e3ee92371bc0c39266b89f7