From 137f4ac82d8792dfc3cc67e39e153fb6373821ba Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Mon, 22 Jul 2024 14:17:36 +0200 Subject: [PATCH] Add phpDoc and update phpstan-baseline --- library/Reporting/Web/Forms/ReportForm.php | 6 +++--- phpstan-baseline.neon | 25 +++++----------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/library/Reporting/Web/Forms/ReportForm.php b/library/Reporting/Web/Forms/ReportForm.php index c378082..709bce3 100644 --- a/library/Reporting/Web/Forms/ReportForm.php +++ b/library/Reporting/Web/Forms/ReportForm.php @@ -19,6 +19,7 @@ class ReportForm extends CompatForm { use ProvidedReports; + /** @var ?int */ protected $id; /** @var string Label to use for the submit button */ @@ -107,7 +108,7 @@ public function hasBeenSubmitted(): bool ); } - protected function assemble() + protected function assemble(): void { $this->addElement('text', 'name', [ 'required' => true, @@ -179,7 +180,6 @@ protected function assemble() if (isset($values['reportlet'])) { $config = new Form(); -// $config->populate($this->getValues()); /** @var \Icinga\Module\Reporting\Hook\ReportHook $reportlet */ $reportlet = new $values['reportlet'](); @@ -218,7 +218,7 @@ protected function assemble() } } - public function onSuccess() + public function onSuccess(): void { $db = Database::get(); diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 36b8734..581e1cc 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -145,6 +145,11 @@ parameters: count: 1 path: application/forms/SelectBackendForm.php + - + message: "#^Call to an undefined method React\\\\Promise\\\\PromiseInterface\\:\\:otherwise\\(\\)\\.$#" + count: 1 + path: library/Reporting/Actions/SendMail.php + - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Actions\\\\SendMail\\:\\:execute\\(\\) has no return type specified\\.$#" count: 1 @@ -680,31 +685,11 @@ parameters: count: 1 path: library/Reporting/Web/Forms/ReportForm.php - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Web\\\\Forms\\\\ReportForm\\:\\:assemble\\(\\) has no return type specified\\.$#" - count: 1 - path: library/Reporting/Web/Forms/ReportForm.php - - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Web\\\\Forms\\\\ReportForm\\:\\:fromId\\(\\) has parameter \\$id with no type specified\\.$#" - count: 1 - path: library/Reporting/Web/Forms/ReportForm.php - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Web\\\\Forms\\\\ReportForm\\:\\:listReports\\(\\) has no return type specified\\.$#" count: 1 path: library/Reporting/Web/Forms/ReportForm.php - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Web\\\\Forms\\\\ReportForm\\:\\:onSuccess\\(\\) has no return type specified\\.$#" - count: 1 - path: library/Reporting/Web/Forms/ReportForm.php - - - - message: "#^Property Icinga\\\\Module\\\\Reporting\\\\Web\\\\Forms\\\\ReportForm\\:\\:\\$id has no type specified\\.$#" - count: 1 - path: library/Reporting/Web/Forms/ReportForm.php - - message: "#^Call to an undefined method object\\:\\:execute\\(\\)\\.$#" count: 1