Open lucagubler opened 2 weeks ago
I just realized that the issue has already been fixed in the repository, but the problem is that the fix has not been included in an official release yet. The script provided for installing the latest version currently points to version v1.7.1, which doesn't include the fixes for the deprecation warnings in PHP 8.1.
I believe all that's needed here is to either:
Thanks!
Expected Behavior
The
Vspheredb
module should work without deprecation warnings in PHP 8.1 and later versions, with proper type handling for functions such ashex2bin()
andjsonSerialize()
.Current Behavior
Several deprecation warnings appear when using the
Vspheredb
module with PHP 8.1 due to stricter type-checking. These include:null
tohex2bin()
inObjectsController.php
on line 61.jsonSerialize()
withinResourceUsage.php
.Possible Solution
To resolve these warnings:
hex2bin()
.jsonSerialize()
to explicitly declare the return type (e.g.,mixed
) or suppress the warnings using the#[\ReturnTypeWillChange]
attribute.I plan to address these issues myself and will provide a pull request once resolved.
Steps to Reproduce (for bugs)
Vspheredb
module within Icinga Web 2.ObjectsController
andResourceUsage
classes.Your Environment