Commit ba23815
fix: add PHPStan level 8 type guards to lib/functions.php (Cacti#6757)
* fix: add PHPStan level 8 type guards to lib/functions.php
Add defensive type checks (is_array, !== false, int casts) to resolve
PHPStan level 8 errors. No behavioral changes for normal operation;
only error paths (db failure, file open failure) are affected.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix: update version_to_decimal @return docblock to int|string
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix: remove redundant is_array() checks and fix PHPStan errors in functions.php
- remove redundant is_array() guards paired with cacti_sizeof() (same variable)
- assign temp variable before prepare_validate_result() calls (by-ref param)
- remove dead is_array() guard on array_rekey() return (always array)
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix: strict === comparison and return type for sanitize_unserialize_selected_graphs
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
---------
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Co-authored-by: TheWitness <thewitness@cacti.net>1 parent dd701e0 commit ba23815
1 file changed
+218
-102
lines changed
0 commit comments