mirror of
https://github.com/friendica/friendica
synced 2024-12-22 08:00:16 +00:00
Merge pull request #14590 from Art4/phpstan-level-2-in-addons
Fix PHPStan errors level 2 in addons
This commit is contained in:
commit
012cce1ac7
2 changed files with 32 additions and 3 deletions
|
@ -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]);
|
||||
|
|
Loading…
Reference in a new issue