diff options
author | Stefan Giehl <stefan@matomo.org> | 2021-01-15 10:53:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-15 10:53:48 +0300 |
commit | b38578b468d694534db5fabe356db5ffdc58bd6e (patch) | |
tree | f9d0307513b614d966075d946ac5e68bed1c660a /plugins/MobileMessaging | |
parent | 6f957d15b4db3b0d8d54f046de33207044f87681 (diff) |
Introduce PHP CS to improve code quality (#16755)
* Adds PHP CS with a basic config
* automatically check coding style for pull requests
* Disallow usage of eval & create_function and force using Common::safe_unserialize instead of unserialize
* Forbid inline control structures
* fix test
Diffstat (limited to 'plugins/MobileMessaging')
-rw-r--r-- | plugins/MobileMessaging/SMSProvider.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/MobileMessaging/SMSProvider.php b/plugins/MobileMessaging/SMSProvider.php index e4bda11822..297308b14a 100644 --- a/plugins/MobileMessaging/SMSProvider.php +++ b/plugins/MobileMessaging/SMSProvider.php @@ -188,7 +188,9 @@ abstract class SMSProvider $maxCharsAllowed = self::maxCharsAllowed($maximumNumberOfConcatenatedSMS, $smsContentContainsUCS2Chars); $sizeOfSMSContent = self::sizeOfSMSContent($string, $smsContentContainsUCS2Chars); - if ($sizeOfSMSContent <= $maxCharsAllowed) return $string; + if ($sizeOfSMSContent <= $maxCharsAllowed) { + return $string; + } $smsContentContainsUCS2Chars = $smsContentContainsUCS2Chars || self::containsUCS2Characters($appendedString); $maxCharsAllowed = self::maxCharsAllowed($maximumNumberOfConcatenatedSMS, $smsContentContainsUCS2Chars); @@ -214,7 +216,9 @@ abstract class SMSProvider private static function sizeOfSMSContent($smsContent, $containsUCS2Chars) { - if ($containsUCS2Chars) return Common::mb_strlen($smsContent); + if ($containsUCS2Chars) { + return Common::mb_strlen($smsContent); + } $sizeOfSMSContent = 0; foreach (self::mb_str_split($smsContent) as $char) { |