From b04f85de0942bea6366e7f3ed797f8501d054963 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Wed, 8 May 2024 09:24:45 +0200 Subject: [PATCH] Phpstan: Cleanup baseline and remove superfluous type hints --- library/Reporting/Web/Forms/ReportForm.php | 2 - library/Reporting/Web/Forms/ScheduleForm.php | 2 - library/Reporting/Web/Forms/TemplateForm.php | 2 - library/Reporting/Web/Forms/TimeframeForm.php | 2 - phpstan-baseline.neon | 90 ------------------- 5 files changed, 98 deletions(-) diff --git a/library/Reporting/Web/Forms/ReportForm.php b/library/Reporting/Web/Forms/ReportForm.php index 40e376e..83aa179 100644 --- a/library/Reporting/Web/Forms/ReportForm.php +++ b/library/Reporting/Web/Forms/ReportForm.php @@ -7,7 +7,6 @@ use Icinga\Authentication\Auth; use Icinga\Module\Reporting\Database; use Icinga\Module\Reporting\ProvidedReports; -use ipl\Html\Contract\FormSubmitElement; use ipl\Html\Form; use ipl\Html\HtmlDocument; use ipl\Validator\CallbackValidator; @@ -167,7 +166,6 @@ protected function assemble() ]); if ($this->id !== null) { - /** @var FormSubmitElement $removeButton */ $removeButton = $this->createElement('submit', 'remove', [ 'label' => $this->translate('Remove Report'), 'class' => 'btn-remove', diff --git a/library/Reporting/Web/Forms/ScheduleForm.php b/library/Reporting/Web/Forms/ScheduleForm.php index 72c4767..4fc198a 100644 --- a/library/Reporting/Web/Forms/ScheduleForm.php +++ b/library/Reporting/Web/Forms/ScheduleForm.php @@ -13,7 +13,6 @@ use Icinga\Module\Reporting\ProvidedActions; use Icinga\Module\Reporting\Report; use Icinga\Util\Json; -use ipl\Html\Contract\FormSubmitElement; use ipl\Html\Form; use ipl\Html\HtmlDocument; use ipl\Html\HtmlElement; @@ -130,7 +129,6 @@ protected function assemble() $wrapper = $this->getElement('submit')->getWrapper(); $wrapper->prepend($sendButton); - /** @var FormSubmitElement $removeButton */ $removeButton = $this->createElement('submit', 'remove', [ 'label' => $this->translate('Remove Schedule'), 'class' => 'btn-remove', diff --git a/library/Reporting/Web/Forms/TemplateForm.php b/library/Reporting/Web/Forms/TemplateForm.php index 4cd44a9..184dc80 100644 --- a/library/Reporting/Web/Forms/TemplateForm.php +++ b/library/Reporting/Web/Forms/TemplateForm.php @@ -9,7 +9,6 @@ use Icinga\Authentication\Auth; use Icinga\Module\Reporting\Database; use Icinga\Util\Json; -use ipl\Html\Contract\FormSubmitElement; use ipl\Html\Html; use ipl\Html\HtmlDocument; use ipl\Web\Compat\CompatForm; @@ -139,7 +138,6 @@ protected function assemble() ]); if ($this->template !== null) { - /** @var FormSubmitElement $removeButton */ $removeButton = $this->createElement('submit', 'remove', [ 'label' => $this->translate('Remove Template'), 'class' => 'btn-remove', diff --git a/library/Reporting/Web/Forms/TimeframeForm.php b/library/Reporting/Web/Forms/TimeframeForm.php index 37ea34f..fe84152 100644 --- a/library/Reporting/Web/Forms/TimeframeForm.php +++ b/library/Reporting/Web/Forms/TimeframeForm.php @@ -7,7 +7,6 @@ use DateTime; use Exception; use Icinga\Module\Reporting\Database; -use ipl\Html\Contract\FormSubmitElement; use ipl\Html\FormElement\LocalDateTimeElement; use ipl\Html\HtmlDocument; use ipl\Validator\CallbackValidator; @@ -166,7 +165,6 @@ protected function assemble() ]); if ($this->id !== null) { - /** @var FormSubmitElement $removeButton */ $removeButton = $this->createElement('submit', 'remove', [ 'label' => $this->translate('Remove Time Frame'), 'class' => 'btn-remove', diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 4799ad3..36b8734 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -70,51 +70,6 @@ parameters: count: 1 path: application/clicommands/ScheduleCommand.php - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\ConfigController\\:\\:backendAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/ConfigController.php - - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\ConfigController\\:\\:mailAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/ConfigController.php - - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\ReportController\\:\\:assembleActions\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/ReportController.php - - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\ReportController\\:\\:cloneAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/ReportController.php - - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\ReportController\\:\\:downloadAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/ReportController.php - - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\ReportController\\:\\:editAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/ReportController.php - - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\ReportController\\:\\:indexAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/ReportController.php - - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\ReportController\\:\\:scheduleAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/ReportController.php - - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\ReportController\\:\\:sendAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/ReportController.php - - message: "#^Parameter \\#2 \\$value of static method ipl\\\\Stdlib\\\\Filter\\:\\:equal\\(\\) expects array\\|bool\\|float\\|int\\|string, mixed given\\.$#" count: 1 @@ -125,26 +80,6 @@ parameters: count: 1 path: application/controllers/ReportsController.php - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\ReportsController\\:\\:indexAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/ReportsController.php - - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\ReportsController\\:\\:newAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/ReportsController.php - - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\TemplateController\\:\\:editAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/TemplateController.php - - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\TemplateController\\:\\:indexAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/TemplateController.php - - message: "#^Parameter \\#2 \\$value of static method ipl\\\\Stdlib\\\\Filter\\:\\:equal\\(\\) expects array\\|bool\\|float\\|int\\|string, mixed given\\.$#" count: 1 @@ -155,21 +90,6 @@ parameters: count: 2 path: application/controllers/TemplatesController.php - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\TemplatesController\\:\\:indexAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/TemplatesController.php - - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\TemplatesController\\:\\:newAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/TemplatesController.php - - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\TimeframeController\\:\\:editAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/TimeframeController.php - - message: "#^Parameter \\#2 \\$value of static method ipl\\\\Stdlib\\\\Filter\\:\\:equal\\(\\) expects array\\|bool\\|float\\|int\\|string, mixed given\\.$#" count: 1 @@ -205,16 +125,6 @@ parameters: count: 1 path: application/controllers/TimeframesController.php - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\TimeframesController\\:\\:indexAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/TimeframesController.php - - - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\TimeframesController\\:\\:newAction\\(\\) has no return type specified\\.$#" - count: 1 - path: application/controllers/TimeframesController.php - - message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Forms\\\\ConfigureMailForm\\:\\:createElements\\(\\) has no return type specified\\.$#" count: 1