Merge pull request #14590 from Art4/phpstan-level-2-in-addons

Fix PHPStan errors level 2 in addons
pull/14599/head
Hypolite Petovan 2024-12-16 09:14:29 -05:00 zatwierdzone przez GitHub
commit 012cce1ac7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
2 zmienionych plików z 32 dodań i 3 usunięć

Wyświetl plik

@ -6,13 +6,14 @@ parameters:
level: 2
paths:
# - addon/
- addon/
- src/
excludePaths:
analyse:
- addon/*/lang/*
- addon/*/vendor/*
- addon/convert/UnitConvertor.php
- addon/pumpio/oauth/*
scanDirectories:
@ -39,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

Wyświetl plik

@ -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]);