kopia lustrzana https://github.com/friendica/friendica
Merge pull request #14590 from Art4/phpstan-level-2-in-addons
Fix PHPStan errors level 2 in addonspull/14599/head
commit
012cce1ac7
|
@ -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
|
||||
|
|
|
@ -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]);
|
||||
|
|
Ładowanie…
Reference in New Issue