Fix PHP 8.2 support issues

This commit is contained in:
raviks789 2023-06-27 11:23:58 +02:00
parent 4f6c550ff3
commit 53bc583f79
6 changed files with 11 additions and 1 deletions

View file

@ -33,6 +33,7 @@ jobs:
- name: Setup dependencies
run: composer require -n --no-progress overtrue/phplint
&& git clone --single-branch --branch master https://github.com/Icinga/icingaweb2.git vendor/icingaweb2
&& git clone --single-branch --branch master https://github.com/Icinga/icingadb-web.git vendor/icingadb-web
&& git clone --single-branch --branch snapshot/nightly https://github.com/Icinga/icinga-php-library.git vendor/icinga-php-library
&& git clone --single-branch --branch snapshot/nightly https://github.com/Icinga/icinga-php-thirdparty.git vendor/icinga-php-thirdparty

View file

@ -138,6 +138,8 @@ EOT
}
}
assert(isset($service), '$service not initialized in the loop');
$monObj = $service
? [
"apply Service \"{$icinga2CfgObjPrefix}_{$checkCommand}\" {",

View file

@ -126,6 +126,9 @@ class CustomForm extends Form
]);
}
assert(isset($elementDecorators), '$elementDecorators not initialized in the loop');
assert(isset($element), '$element not initialized in the loop');
$decorators = [];
foreach ($elementDecorators as $key => $decorator) {
if ($key === 'Zend_Form_Decorator_ViewHelper') {

View file

@ -203,6 +203,7 @@ class Template
}
}
unset($_);
assert(isset($nextCurveName), 'loop did not initialize variable $nextCurveName');
$allowedNextCurveMetricsPerCurrentCurveName = [];
foreach ($currentCombination as $currentCurveName => $currentCurveMetric) {

View file

@ -22,6 +22,9 @@ abstract class MonitoringAwareController extends Controller
/** @var bool Whether to use icingadb as the backend */
protected $useIcingadbAsBackend = false;
/** @var MonitoringBackend */
protected $backend;
/**
* Restrict the given monitored object query for the currently authenticated user
*

View file

@ -134,7 +134,7 @@ abstract class Graphs extends AbstractWidget
*
* @param MonitoredObject $object
*
* @return static
* @return ?static
*/
public static function forMonitoredObject(MonitoredObject $object)
{