From 6b29aa9f2962266bd3266705ebec74afe0a7c47f Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Mon, 30 Oct 2023 15:21:49 +0100 Subject: [PATCH] phpstan level 2 --- inc/entity.class.php | 4 ++-- inc/profile.class.php | 5 +++-- inc/ticket.class.php | 4 ++-- phpstan.neon | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/inc/entity.class.php b/inc/entity.class.php index 717827b..a37ec37 100644 --- a/inc/entity.class.php +++ b/inc/entity.class.php @@ -42,7 +42,7 @@ public static function getTypeName($nb = 0) return _n('Credit voucher', 'Credit vouchers', $nb, 'credit'); } - public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) + public function getTabNameForItem(CommonGLPI $item, $withtemplate = false) { $nb = self::countForItem($item); switch ($item->getType()) { @@ -57,7 +57,7 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) return ''; } - public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) + public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = false) { switch ($item->getType()) { case 'Entity': diff --git a/inc/profile.class.php b/inc/profile.class.php index 995f7e4..b4ba279 100644 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -31,14 +31,15 @@ class PluginCreditProfile extends Profile { - public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) + public function getTabNameForItem(CommonGLPI $item, $withtemplate = false) { return self::createTabEntry(PluginCreditTicket::getTypeName(Session::getPluralNumber())); } - public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) + public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = false) { $profile = new self(); + /** @phpstan-ignore-next-line */ $profile->showForm($item->getID()); return true; } diff --git a/inc/ticket.class.php b/inc/ticket.class.php index 1b164bd..5cc0237 100644 --- a/inc/ticket.class.php +++ b/inc/ticket.class.php @@ -42,7 +42,7 @@ public static function getTypeName($nb = 0) return _n('Credit voucher', 'Credit vouchers', $nb, 'credit'); } - public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) + public function getTabNameForItem(CommonGLPI $item, $withtemplate = false) { $nb = self::countForItem($item); switch ($item->getType()) { @@ -58,7 +58,7 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) return ''; } - public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) + public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = false) { switch ($item->getType()) { case 'Ticket': diff --git a/phpstan.neon b/phpstan.neon index 7d28e22..a9cb812 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,7 +1,7 @@ parameters: parallel: maximumNumberOfProcesses: 2 - level: 1 + level: 2 bootstrapFiles: - ../../inc/based_config.php - setup.php