From 5422ba42b602e3d6f4884ceffabfe9d07a541a95 Mon Sep 17 00:00:00 2001 From: Art4 Date: Sat, 7 Dec 2024 21:18:48 +0000 Subject: [PATCH 1/4] add checks for addon folder --- .phpstan.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.phpstan.neon b/.phpstan.neon index fca7f6d59d..8978a15eb5 100644 --- a/.phpstan.neon +++ b/.phpstan.neon @@ -6,7 +6,7 @@ parameters: level: 2 paths: - # - addon/ + - addon/ - src/ excludePaths: From cf6d7fbb76cfcc49667ca78ddae988b085c33072 Mon Sep 17 00:00:00 2001 From: Art4 Date: Sat, 7 Dec 2024 22:08:27 +0000 Subject: [PATCH 2/4] Ignore vender class UnitConverter.php --- .phpstan.neon | 1 + 1 file changed, 1 insertion(+) diff --git a/.phpstan.neon b/.phpstan.neon index 8978a15eb5..e6c0e87c84 100644 --- a/.phpstan.neon +++ b/.phpstan.neon @@ -13,6 +13,7 @@ parameters: analyse: - addon/*/lang/* - addon/*/vendor/* + - addon/convert/UnitConvertor.php - addon/pumpio/oauth/* scanDirectories: From 020d1f6e30f70ec49806b06929c8e6e052319659 Mon Sep 17 00:00:00 2001 From: Art4 Date: Sun, 8 Dec 2024 21:17:56 +0000 Subject: [PATCH 3/4] Ignore missing SMTP class in PHPMailer --- .phpstan.neon | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.phpstan.neon b/.phpstan.neon index e6c0e87c84..2a89c7ae1a 100644 --- a/.phpstan.neon +++ b/.phpstan.neon @@ -40,3 +40,27 @@ parameters: # Ignore missing IMAP\Connection class in PHP <= 8.0 message: '(^Parameter .+ has invalid type IMAP\\Connection\.$)' path: src + + - + # Ignore missing SMTP class in PHPMailer 5.2.21 + # see https://github.com/PHPMailer/PHPMailer/blob/v5.2.21/class.smtp.php + message: '(^.+ an unknown class SMTP\.$)' + path: addon/mailstream/phpmailer + + - + # Ignore missing SMTP class in PHPMailer 5.2.21 + # see https://github.com/PHPMailer/PHPMailer/blob/v5.2.21/class.smtp.php + message: '(^Property .+ has unknown class SMTP as its type\.$)' + path: addon/mailstream/phpmailer + + - + # Ignore missing SMTP class in PHPMailer 5.2.21 + # see https://github.com/PHPMailer/PHPMailer/blob/v5.2.21/class.smtp.php + message: '(^Method .+ has invalid return type SMTP\.$)' + path: addon/mailstream/phpmailer + + - + # Ignore missing SMTP class in PHPMailer 5.2.21 + # see https://github.com/PHPMailer/PHPMailer/blob/v5.2.21/class.smtp.php + message: '(^Instantiated class SMTP not found\.$)' + path: addon/mailstream/phpmailer From 3cd098bfc7021e025df29dd16efa1beee43eb0e1 Mon Sep 17 00:00:00 2001 From: Art4 Date: Sun, 8 Dec 2024 22:20:20 +0000 Subject: [PATCH 4/4] Fix Util Strings --- src/Util/Strings.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Util/Strings.php b/src/Util/Strings.php index 46d10529a9..fbf691879e 100644 --- a/src/Util/Strings.php +++ b/src/Util/Strings.php @@ -530,8 +530,12 @@ class Strings { $shorthand = trim($shorthand); - if (is_numeric($shorthand)) { - return $shorthand; + if (ctype_digit($shorthand)) { + return (int) $shorthand; + } + + if ($shorthand === '') { + return 0; } $last = strtolower($shorthand[strlen($shorthand) - 1]);