From c24a4147cd07c6c067174a92dec092b72eb9865a Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 23 Nov 2025 05:11:45 +0100 Subject: [PATCH] PHPCS: add a few more selective ignores ... for things already handled correctly in the code. --- src/PHPMailer.php | 4 ++++ test/Fixtures/LocalizationTest/phpmailer.lang-yz.php | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/PHPMailer.php b/src/PHPMailer.php index f37eab7d..bd9825f3 100644 --- a/src/PHPMailer.php +++ b/src/PHPMailer.php @@ -1258,8 +1258,10 @@ class PHPMailer $addresses = []; if (function_exists('imap_rfc822_parse_adrlist')) { //Use this built-in parser if it's available + // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.imap_rfc822_parse_adrlistRemoved -- wrapped in function_exists() $list = imap_rfc822_parse_adrlist($addrstr, ''); // Clear any potential IMAP errors to get rid of notices being thrown at end of script. + // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.imap_errorsRemoved -- wrapped in function_exists() imap_errors(); foreach ($list as $address) { if ( @@ -5117,12 +5119,14 @@ class PHPMailer } if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) { if (\PHP_MAJOR_VERSION < 8) { + // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.openssl_pkey_freeDeprecated openssl_pkey_free($privKey); } return base64_encode($signature); } if (\PHP_MAJOR_VERSION < 8) { + // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.openssl_pkey_freeDeprecated openssl_pkey_free($privKey); } diff --git a/test/Fixtures/LocalizationTest/phpmailer.lang-yz.php b/test/Fixtures/LocalizationTest/phpmailer.lang-yz.php index 2b0f8aa3..1d190b4b 100644 --- a/test/Fixtures/LocalizationTest/phpmailer.lang-yz.php +++ b/test/Fixtures/LocalizationTest/phpmailer.lang-yz.php @@ -8,6 +8,8 @@ * Note: this test fixture uses a syntax (backticks) which has been deprecated in PHP 8.5 and * is slated for removal in PHP 9.0. * For that reason, the file is excluded from the linting check on PHP 8.5 and above. + * + * @phpcs:disable PHPCompatibility.LanguageConstructs.RemovedLanguageConstructs.t_backtickDeprecated */ $PHPMAILER_LANG['extension_missing'] = 'Confirming that test fixture was loaded correctly (yz).';