diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index c596c38..12d1283 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.2', '7.3', '7.4', '8.0', '8.1'] + php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] os: ['ubuntu-latest'] steps: @@ -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 diff --git a/application/clicommands/Icinga2Command.php b/application/clicommands/Icinga2Command.php index 816e063..e0e0ee4 100644 --- a/application/clicommands/Icinga2Command.php +++ b/application/clicommands/Icinga2Command.php @@ -138,6 +138,8 @@ EOT } } + assert(isset($service), '$service not initialized in the loop'); + $monObj = $service ? [ "apply Service \"{$icinga2CfgObjPrefix}_{$checkCommand}\" {", diff --git a/application/forms/TimeRangePicker/CustomForm.php b/application/forms/TimeRangePicker/CustomForm.php index 89b5833..8627267 100644 --- a/application/forms/TimeRangePicker/CustomForm.php +++ b/application/forms/TimeRangePicker/CustomForm.php @@ -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') { diff --git a/library/Graphite/Graphing/Template.php b/library/Graphite/Graphing/Template.php index a030fb7..0950fed 100644 --- a/library/Graphite/Graphing/Template.php +++ b/library/Graphite/Graphing/Template.php @@ -203,6 +203,7 @@ class Template } } unset($_); + assert(isset($nextCurveName), 'loop did not initialize variable $nextCurveName'); $allowedNextCurveMetricsPerCurrentCurveName = []; foreach ($currentCombination as $currentCurveName => $currentCurveMetric) { diff --git a/library/Graphite/Web/Controller/MonitoringAwareController.php b/library/Graphite/Web/Controller/MonitoringAwareController.php index dca2ebd..d4f1a07 100644 --- a/library/Graphite/Web/Controller/MonitoringAwareController.php +++ b/library/Graphite/Web/Controller/MonitoringAwareController.php @@ -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 * diff --git a/library/Graphite/Web/Widget/Graphs.php b/library/Graphite/Web/Widget/Graphs.php index e18b8da..29c3160 100644 --- a/library/Graphite/Web/Widget/Graphs.php +++ b/library/Graphite/Web/Widget/Graphs.php @@ -134,7 +134,7 @@ abstract class Graphs extends AbstractWidget * * @param MonitoredObject $object * - * @return static + * @return ?static */ public static function forMonitoredObject(MonitoredObject $object) {