You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Vspheredb module should work without deprecation warnings in PHP 8.1 and later versions, with proper type handling for functions such as hex2bin() and jsonSerialize().
Current Behavior
Several deprecation warnings appear when using the Vspheredb module with PHP 8.1 due to stricter type-checking. These include:
Passing null to hex2bin() in ObjectsController.php on line 61.
Return type issues in jsonSerialize() within ResourceUsage.php.
Possible Solution
To resolve these warnings:
Add proper null checks before passing values to functions like hex2bin().
Update methods like 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)
Upgrade to PHP 8.1.
Use the Vspheredb module within Icinga Web 2.
Trigger actions that involve the ObjectsController and ResourceUsage classes.
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:
Bump the version and release a new version that includes the latest fixes (e.g. v1.7.2)
Modify the install script to pull from the master branch until a new version is officially released.
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
The text was updated successfully, but these errors were encountered: