From 83ddd30fe644168d59be0f958574ea88b17c18a8 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 11 Jan 2022 22:20:58 +0000 Subject: [PATCH 01/42] Enforce consistent indentation --- eslint/.eslintrc-magento | 1 + eslint/rules/utils.js | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/eslint/.eslintrc-magento b/eslint/.eslintrc-magento index 5d403da3..0ae1f657 100644 --- a/eslint/.eslintrc-magento +++ b/eslint/.eslintrc-magento @@ -18,6 +18,7 @@ "eol-last": 2, "eqeqeq": [2, "smart"], "guard-for-in": 2, + "indent": [2, 4], "keyword-spacing": [2, {}], "lines-around-comment": [ 2, diff --git a/eslint/rules/utils.js b/eslint/rules/utils.js index ae181210..398e2b86 100644 --- a/eslint/rules/utils.js +++ b/eslint/rules/utils.js @@ -75,18 +75,18 @@ function getExpressionId(node) { while (node) { switch (node.type) { - case 'CallExpression': - node = node.callee; - break; - - case 'MemberExpression': - node = node.object; - break; - - case 'Identifier': - return node; - default: - return null; + case 'CallExpression': + node = node.callee; + break; + + case 'MemberExpression': + node = node.object; + break; + + case 'Identifier': + return node; + default: + return null; } } } From 0f1c1f195aa12117e80b7e9026338ce4528ea19e Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 11 Jan 2022 22:27:50 +0000 Subject: [PATCH 02/42] Forbid overriding built-in objects --- eslint/.eslintrc-magento | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/.eslintrc-magento b/eslint/.eslintrc-magento index 5d403da3..f84ff61c 100644 --- a/eslint/.eslintrc-magento +++ b/eslint/.eslintrc-magento @@ -50,6 +50,7 @@ "no-fallthrough": 2, "no-floating-decimal": 2, "no-func-assign": 2, + "no-global-assign": 2, "no-implied-eval": 2, "no-inner-declarations": 2, "no-invalid-regexp": 2, From 241f932a0324776cee6f451a9dbd8b3ba1064152 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 11 Jan 2022 22:37:45 +0000 Subject: [PATCH 03/42] Disallow useless constructs --- eslint/.eslintrc-magento | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eslint/.eslintrc-magento b/eslint/.eslintrc-magento index 5d403da3..7283333c 100644 --- a/eslint/.eslintrc-magento +++ b/eslint/.eslintrc-magento @@ -81,6 +81,12 @@ } ], "no-use-before-define": 2, + "no-useless-call": 2, + "no-useless-computed-key": 2, + "no-useless-constructor": 2, + "no-useless-escape": 2, + "no-useless-rename": 2, + "no-useless-return": 2, "no-with": 2, "one-var": [2, "always"], "operator-assignment": [2, "always"], From 784a702a0923366be28ed62f1d2feb2efc27ae98 Mon Sep 17 00:00:00 2001 From: Kiel Pykett Date: Tue, 25 Jan 2022 10:18:06 +0000 Subject: [PATCH 04/42] Allow Template Literals --- eslint/.eslintrc-magento | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/.eslintrc-magento b/eslint/.eslintrc-magento index 5d403da3..a25fcf5c 100644 --- a/eslint/.eslintrc-magento +++ b/eslint/.eslintrc-magento @@ -84,7 +84,7 @@ "no-with": 2, "one-var": [2, "always"], "operator-assignment": [2, "always"], - "quotes": [2, "single"], + "quotes": [2, "single", {"allowTemplateLiterals": true}], "radix": 2, "semi": [2, "always"], "semi-spacing": 2, From 21db43236599f62bc161b1fdb35c7daa9559acac Mon Sep 17 00:00:00 2001 From: Aad Mathijssen Date: Fri, 4 Mar 2022 20:27:46 +0100 Subject: [PATCH 05/42] Add semicolon as statement separator in the special annotation check of the `Magento2.Security.XssTemplate` sniff --- Magento2/Sniffs/Security/XssTemplateSniff.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Magento2/Sniffs/Security/XssTemplateSniff.php b/Magento2/Sniffs/Security/XssTemplateSniff.php index 3b4385e8..c7067d20 100644 --- a/Magento2/Sniffs/Security/XssTemplateSniff.php +++ b/Magento2/Sniffs/Security/XssTemplateSniff.php @@ -146,11 +146,11 @@ public function process(File $phpcsFile, $stackPtr) private function findSpecialAnnotation($stackPtr) { if ($this->tokens[$stackPtr]['code'] === T_ECHO) { - $startOfStatement = $this->file->findPrevious(T_OPEN_TAG, $stackPtr); + $startOfStatement = $this->file->findPrevious([T_OPEN_TAG, T_SEMICOLON], $stackPtr); return $this->file->findPrevious(T_COMMENT, $stackPtr, $startOfStatement); } if ($this->tokens[$stackPtr]['code'] === T_OPEN_TAG_WITH_ECHO) { - $endOfStatement = $this->file->findNext(T_CLOSE_TAG, $stackPtr); + $endOfStatement = $this->file->findNext([T_CLOSE_TAG, T_SEMICOLON], $stackPtr); return $this->file->findNext(T_COMMENT, $stackPtr, $endOfStatement); } return false; From b67b07208b818aa9c3ab74104b1e5454241779a9 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Wed, 13 Jul 2022 11:08:52 +0100 Subject: [PATCH 06/42] Include all Magento2 sniffs in Magento2Framework --- Magento2Framework/ruleset.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Magento2Framework/ruleset.xml b/Magento2Framework/ruleset.xml index 5e16e7a1..5c4eef70 100644 --- a/Magento2Framework/ruleset.xml +++ b/Magento2Framework/ruleset.xml @@ -4,6 +4,8 @@ + + 5 warning From 5936239050ddb99f5aea5c9ab655efbc1e6c2c35 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 26 Jan 2023 11:51:03 +0000 Subject: [PATCH 07/42] Automatically remove useless comments When issues are detected and classified as Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags or Magento2.Commenting.ClassAndInterfacePHPDocFormatting.InvalidDescription, these can be fixed by removing the offending comment. --- ...ClassAndInterfacePHPDocFormattingSniff.php | 42 ++++- ...AndInterfacePHPDocFormattingUnitTest.1.inc | 7 + ...erfacePHPDocFormattingUnitTest.1.inc.fixed | 166 ++++++++++++++++++ ...AndInterfacePHPDocFormattingUnitTest.2.inc | 17 ++ ...erfacePHPDocFormattingUnitTest.2.inc.fixed | 166 ++++++++++++++++++ ...ssAndInterfacePHPDocFormattingUnitTest.php | 3 +- 6 files changed, 398 insertions(+), 3 deletions(-) create mode 100644 Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc.fixed create mode 100644 Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc.fixed diff --git a/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php b/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php index 2d715c50..fec9f396 100644 --- a/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php +++ b/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php @@ -62,8 +62,10 @@ public function process(File $phpcsFile, $stackPtr) return; } + $commentCloserPtr = $tokens[$commentStartPtr]['comment_closer']; + if ($this->PHPDocFormattingValidator->providesMeaning($namePtr, $commentStartPtr, $tokens) !== true) { - $phpcsFile->addWarning( + $fix = $phpcsFile->addFixableWarning( sprintf( '%s description must contain meaningful information beyond what its name provides or be removed.', ucfirst($tokens[$stackPtr]['content']) @@ -71,6 +73,18 @@ public function process(File $phpcsFile, $stackPtr) $stackPtr, 'InvalidDescription' ); + + if ($fix) { + for ($i = $commentStartPtr; $i <= $commentCloserPtr; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + if ($tokens[$commentStartPtr - 1]['code'] === T_WHITESPACE + && $tokens[$commentCloserPtr + 1]['code'] === T_WHITESPACE + ) { + $phpcsFile->fixer->replaceToken($commentCloserPtr + 1, ''); + } + } } if ($this->PHPDocFormattingValidator->hasDeprecatedWellFormatted($commentStartPtr, $tokens) !== true) { @@ -104,11 +118,35 @@ private function validateTags(File $phpcsFile, $commentStartPtr, $tokens) } if (in_array($tokens[$i]['content'], $this->forbiddenTags) === true) { - $phpcsFile->addWarning( + $fix = $phpcsFile->addFixableWarning( sprintf('Tag %s MUST NOT be used.', $tokens[$i]['content']), $i, 'ForbiddenTags' ); + + if ($fix) { + for ($j = $i - 1; $j > $commentStartPtr; $j--) { + if (!in_array($tokens[$j]['code'], [T_DOC_COMMENT_STAR, T_DOC_COMMENT_WHITESPACE], true)) { + break; + } + + if ($tokens[$j]['code'] === T_DOC_COMMENT_WHITESPACE && $tokens[$j]['content'] === "\n") { + break; + } + + $phpcsFile->fixer->replaceToken($j, ''); + } + + $phpcsFile->fixer->replaceToken($i, ''); + + for ($j = $i + 1; $j < $commentCloserPtr; $j++) { + $phpcsFile->fixer->replaceToken($j, ''); + + if ($tokens[$j]['code'] === T_DOC_COMMENT_WHITESPACE && $tokens[$j]['content'] === "\n") { + break; + } + } + } } } diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc index afd4c934..a17e80c8 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc @@ -179,3 +179,10 @@ class AlsoDeprecatedButHandler } +/** + * @package this tag should not be used + */ +class OnlyUselessCommentContent +{ + +} diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc.fixed b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc.fixed new file mode 100644 index 00000000..6be0195c --- /dev/null +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc.fixed @@ -0,0 +1,166 @@ + 1, 109 => 1, 118 => 1, - 127 => 1 + 127 => 1, + 183 => 1, ]; } } From 18a457925b43c41bd9020b33d53dd381e2e74037 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 14 Feb 2023 20:02:11 +0000 Subject: [PATCH 08/42] Ensure only the relevant docblock is read --- .../Sniffs/Annotation/MethodAnnotationStructureSniff.php | 3 ++- .../Annotation/MethodAnnotationStructureUnitTest.inc | 8 ++++++++ .../Annotation/MethodAnnotationStructureUnitTest.php | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php b/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php index 538f80c9..d6f7ca3c 100644 --- a/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php +++ b/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php @@ -53,7 +53,8 @@ public function process(File $phpcsFile, $stackPtr) $tokens = $phpcsFile->getTokens(); $commentStartPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, ($stackPtr), 0); $commentEndPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, ($stackPtr), 0); - if (!$commentStartPtr) { + $prevSemicolon = $phpcsFile->findPrevious(T_SEMICOLON, $stackPtr, $commentEndPtr); + if (!$commentStartPtr || $prevSemicolon) { $phpcsFile->addError('Comment block is missing', $stackPtr, 'MethodArguments'); return; } diff --git a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc index 2e0fdf0e..6402dad8 100644 --- a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc +++ b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc @@ -389,4 +389,12 @@ class MethodAnnotationFixture { return false; } + + /** @var OutputInterface */ + private $output; + + private function thisMethodHasNoDocBlock(): bool + { + return false; + } } diff --git a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.php b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.php index b4c80141..9494e2d1 100644 --- a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.php +++ b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.php @@ -31,13 +31,15 @@ public function getErrorList() 185 => 1, 227 => 1, 235 => 1, + 261 => 1, 268 => 2, 269 => 1, 277 => 1, 278 => 1, 288 => 1, 289 => 1, - 298 => 1 + 298 => 1, + 396 => 1, ]; } From daed7c6d2863108579db68bede8fdb334f1cf184 Mon Sep 17 00:00:00 2001 From: Joan He Date: Mon, 10 Apr 2023 17:43:45 -0500 Subject: [PATCH 09/42] B2B-2606: Graphql Parser called at least 3 times per request --- Magento2/Sniffs/Legacy/_files/restricted_classes.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Magento2/Sniffs/Legacy/_files/restricted_classes.php b/Magento2/Sniffs/Legacy/_files/restricted_classes.php index 3269caca..90092aa7 100644 --- a/Magento2/Sniffs/Legacy/_files/restricted_classes.php +++ b/Magento2/Sniffs/Legacy/_files/restricted_classes.php @@ -395,5 +395,10 @@ 'Magento/Ui/Test/Unit/Model/ManagerTest.php', 'Magento/Framework/View/Element/UiComponent/Config/Provider/Component/Definition.php', ] + ], + 'GraphQL\Language\Parser' => [ + 'warning_code' => 'GraphQLLanguageParserIsRestricted', + 'replacement' => 'Magento\Framework\GraphQl\Query\QueryParser', + 'exclude' => [] ] ]; From ed981cff04b257f9e8c265b63fc76cad4f386a86 Mon Sep 17 00:00:00 2001 From: Kiel Pykett Date: Sat, 15 Apr 2023 01:34:46 +0100 Subject: [PATCH 10/42] Make Unescaped Output Error With Severity 10 --- Magento2/ruleset.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Magento2/ruleset.xml b/Magento2/ruleset.xml index ee171871..81ff0d8d 100644 --- a/Magento2/ruleset.xml +++ b/Magento2/ruleset.xml @@ -94,6 +94,10 @@ 10 error + + 10 + error + 10 error From 0197a5ff31b4a5a816047e70cb015d00dde0d698 Mon Sep 17 00:00:00 2001 From: soumah Date: Wed, 26 Apr 2023 10:36:55 -0500 Subject: [PATCH 11/42] ACP2E-1887: Remove phpcsutils classes and add dependency on phpcsstandards/phpcsutils --- .../PHPCSUtils/BackCompat/BCTokens.php | 109 --- .../Helpers/PHPCSUtils/BackCompat/Helper.php | 242 ------ .../TestUtils/UtilityMethodTestCase.php | 450 ----------- .../Helpers/PHPCSUtils/Tokens/Collections.php | 369 --------- .../Helpers/PHPCSUtils/Utils/Conditions.php | 119 --- .../PHPCSUtils/Utils/FunctionDeclarations.php | 754 ------------------ .../PHPCSUtils/Utils/GetTokensAsString.php | 188 ----- .../PHPCSUtils/Utils/ObjectDeclarations.php | 363 --------- .../Helpers/PHPCSUtils/Utils/Parentheses.php | 155 ---- Magento2/Helpers/PHPCSUtils/Utils/Scopes.php | 80 -- .../Helpers/PHPCSUtils/Utils/TextStrings.php | 133 --- .../PHPCSUtils/Utils/UseStatements.php | 412 ---------- .../ChangedIntToBoolParamTypeSniff.php | 2 +- .../ForbiddenFinalPrivateMethodsSniff.php | 4 +- ...llingDestructAfterConstructorExitSniff.php | 15 +- ...emovedOptionalBeforeRequiredParamSniff.php | 18 +- .../Tests/PHPCompatibility/BaseSniffTest.php | 2 +- .../Util/CoreMethodTestFrame.php | 51 -- .../Util/TestHelperPHPCompatibility.php | 92 --- composer.json | 8 +- composer.lock | 154 +++- 21 files changed, 178 insertions(+), 3542 deletions(-) delete mode 100644 Magento2/Helpers/PHPCSUtils/BackCompat/BCTokens.php delete mode 100644 Magento2/Helpers/PHPCSUtils/BackCompat/Helper.php delete mode 100644 Magento2/Helpers/PHPCSUtils/TestUtils/UtilityMethodTestCase.php delete mode 100644 Magento2/Helpers/PHPCSUtils/Tokens/Collections.php delete mode 100644 Magento2/Helpers/PHPCSUtils/Utils/Conditions.php delete mode 100644 Magento2/Helpers/PHPCSUtils/Utils/FunctionDeclarations.php delete mode 100644 Magento2/Helpers/PHPCSUtils/Utils/GetTokensAsString.php delete mode 100644 Magento2/Helpers/PHPCSUtils/Utils/ObjectDeclarations.php delete mode 100644 Magento2/Helpers/PHPCSUtils/Utils/Parentheses.php delete mode 100644 Magento2/Helpers/PHPCSUtils/Utils/Scopes.php delete mode 100644 Magento2/Helpers/PHPCSUtils/Utils/TextStrings.php delete mode 100644 Magento2/Helpers/PHPCSUtils/Utils/UseStatements.php delete mode 100644 Magento2/Tests/PHPCompatibility/Util/CoreMethodTestFrame.php delete mode 100644 Magento2/Tests/PHPCompatibility/Util/TestHelperPHPCompatibility.php diff --git a/Magento2/Helpers/PHPCSUtils/BackCompat/BCTokens.php b/Magento2/Helpers/PHPCSUtils/BackCompat/BCTokens.php deleted file mode 100644 index 4542f9c6..00000000 --- a/Magento2/Helpers/PHPCSUtils/BackCompat/BCTokens.php +++ /dev/null @@ -1,109 +0,0 @@ - => - */ - private static $ooScopeTokens = [ - \T_CLASS => \T_CLASS, - \T_ANON_CLASS => \T_ANON_CLASS, - \T_INTERFACE => \T_INTERFACE, - \T_TRAIT => \T_TRAIT, - ]; - - /** - * Tokens that open class and object scopes. - * - * Retrieve the OO scope tokens array in a cross-version compatible manner. - * - * Changelog for the PHPCS native array: - * - Introduced in PHPCS 3.1.0. - * - * @see \PHP_CodeSniffer\Util\Tokens::$ooScopeTokens Original array. - * - * @since 1.0.0 - * - * @return array => Token array. - */ - public static function ooScopeTokens() - { - return self::$ooScopeTokens; - } - - /** - * Tokens that represent arithmetic operators. - * - * Retrieve the PHPCS arithmetic tokens array in a cross-version compatible manner. - * - * Changelog for the PHPCS native array: - * - Introduced in PHPCS 0.5.0. - * - PHPCS 2.9.0: The PHP 5.6 `T_POW` token was added to the array. - * The `T_POW` token was introduced in PHPCS 2.4.0. - * - * @see \PHP_CodeSniffer\Util\Tokens::$arithmeticTokens Original array. - * - * @since 1.0.0 - * - * @return array => Token array or an empty array for PHPCS versions in - * which the PHPCS native comment tokens did not exist yet. - */ - public static function arithmeticTokens() - { - return Tokens::$arithmeticTokens + [\T_POW => \T_POW]; - } - - /** - * Tokens that represent assignment operators. - * - * Retrieve the PHPCS assignment tokens array in a cross-version compatible manner. - * - * Changelog for the PHPCS native array: - * - Introduced in PHPCS 0.0.5. - * - PHPCS 2.9.0: The PHP 7.4 `T_COALESCE_EQUAL` token was added to the array. - * The `T_COALESCE_EQUAL` token was introduced in PHPCS 2.8.1. - * - PHPCS 3.2.0: The JS `T_ZSR_EQUAL` token was added to the array. - * The `T_ZSR_EQUAL` token was introduced in PHPCS 2.8.0. - * - * @see \PHP_CodeSniffer\Util\Tokens::$assignmentTokens Original array. - * - * @since 1.0.0 - * - * @return array => Token array. - */ - public static function assignmentTokens() - { - $tokens = Tokens::$assignmentTokens; - - /* - * The `T_COALESCE_EQUAL` token may be available pre-PHPCS 2.8.1 depending on - * the PHP version used to run PHPCS. - */ - if (\defined('T_COALESCE_EQUAL')) { - $tokens[\T_COALESCE_EQUAL] = \T_COALESCE_EQUAL; - } - - if (\defined('T_ZSR_EQUAL')) { - $tokens[\T_ZSR_EQUAL] = \T_ZSR_EQUAL; - } - - return $tokens; - } -} diff --git a/Magento2/Helpers/PHPCSUtils/BackCompat/Helper.php b/Magento2/Helpers/PHPCSUtils/BackCompat/Helper.php deleted file mode 100644 index d82f39c2..00000000 --- a/Magento2/Helpers/PHPCSUtils/BackCompat/Helper.php +++ /dev/null @@ -1,242 +0,0 @@ -config` property should work - * in PHPCS 3.x and higher. - * - * @return bool Whether the setting of the data was successfull. - */ - public static function setConfigData($key, $value, $temp = false, $config = null) - { - if (\method_exists('\PHP_CodeSniffer\Config', 'setConfigData') === false) { - // PHPCS 2.x. - return \PHP_CodeSniffer::setConfigData($key, $value, $temp); - } - - if (isset($config) === true) { - // PHPCS 3.x and 4.x. - return $config->setConfigData($key, $value, $temp); - } - - if (\version_compare(self::getVersion(), '3.99.99', '>') === true) { - throw new RuntimeException('Passing the $config parameter is required in PHPCS 4.x'); - } - - // PHPCS 3.x. - return \PHP_CodeSniffer\Config::setConfigData($key, $value, $temp); - } - - /** - * Get the value of a single PHP_CodeSniffer config key. - * - * @see Helper::getCommandLineData() Alternative for the same which is more reliable - * if the `$phpcsFile` object is available. - * - * @since 1.0.0 - * - * @param string $key The name of the config value. - * - * @return string|null - */ - public static function getConfigData($key) - { - if (\method_exists('\PHP_CodeSniffer\Config', 'getConfigData') === false) { - // PHPCS 2.x. - return \PHP_CodeSniffer::getConfigData($key); - } - - // PHPCS 3.x. - return \PHP_CodeSniffer\Config::getConfigData($key); - } - - /** - * Get the value of a CLI overrulable single PHP_CodeSniffer config key. - * - * Use this for config keys which can be set in the `CodeSniffer.conf` file, - * on the command-line or in a ruleset. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * @param string $key The name of the config value. - * - * @return string|null - */ - public static function getCommandLineData(File $phpcsFile, $key) - { - if (\class_exists('\PHP_CodeSniffer\Config') === false) { - // PHPCS 2.x. - $config = $phpcsFile->phpcs->cli->getCommandLineValues(); - if (isset($config[$key])) { - return $config[$key]; - } - } else { - // PHPCS 3.x. - $config = $phpcsFile->config; - if (isset($config->{$key})) { - return $config->{$key}; - } - } - - return null; - } - - /** - * Get the applicable tab width as passed to PHP_CodeSniffer from the - * command-line or the ruleset. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being processed. - * - * @return int Tab width. Defaults to the PHPCS native default of 4. - */ - public static function getTabWidth(File $phpcsFile) - { - $tabWidth = self::getCommandLineData($phpcsFile, 'tabWidth'); - if ($tabWidth > 0) { - return (int) $tabWidth; - } - - return self::DEFAULT_TABWIDTH; - } - - /** - * Get the applicable (file) encoding as passed to PHP_CodeSniffer from the - * command-line or the ruleset. - * - * @since 1.0.0-alpha3 - * - * @param \PHP_CodeSniffer\Files\File|null $phpcsFile Optional. The current file being processed. - * - * @return string Encoding. Defaults to the PHPCS native default, which is 'utf-8' - * for PHPCS 3.x and was 'iso-8859-1' for PHPCS 2.x. - */ - public static function getEncoding(File $phpcsFile = null) - { - static $default; - - if (isset($default) === false) { - $default = 'utf-8'; - if (\version_compare(self::getVersion(), '2.99.99', '<=') === true) { - // In PHPCS 2.x, the default encoding is `iso-8859-1`. - $default = 'iso-8859-1'; - } - } - - if ($phpcsFile instanceof File) { - // Most reliable. - $encoding = self::getCommandLineData($phpcsFile, 'encoding'); - if ($encoding === null) { - $encoding = $default; - } - - return $encoding; - } - - // Less reliable. - $encoding = self::getConfigData('encoding'); - if ($encoding === null) { - $encoding = $default; - } - - return $encoding; - } - - /** - * Check whether the "--ignore-annotations" option is in effect. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File|null $phpcsFile Optional. The current file being processed. - * - * @return bool `TRUE` if annotations should be ignored, `FALSE` otherwise. - */ - public static function ignoreAnnotations(File $phpcsFile = null) - { - if (\class_exists('\PHP_CodeSniffer\Config') === false) { - // PHPCS 2.x does not support `--ignore-annotations`. - return false; - } - - // PHPCS 3.x. - if (isset($phpcsFile, $phpcsFile->config->annotations)) { - return ! $phpcsFile->config->annotations; - } - - $annotations = \PHP_CodeSniffer\Config::getConfigData('annotations'); - if (isset($annotations)) { - return ! $annotations; - } - - return false; - } -} diff --git a/Magento2/Helpers/PHPCSUtils/TestUtils/UtilityMethodTestCase.php b/Magento2/Helpers/PHPCSUtils/TestUtils/UtilityMethodTestCase.php deleted file mode 100644 index 7ffcc1e3..00000000 --- a/Magento2/Helpers/PHPCSUtils/TestUtils/UtilityMethodTestCase.php +++ /dev/null @@ -1,450 +0,0 @@ -getTargetToken($commentString, [\T_TOKEN_CONSTANT, \T_ANOTHER_TOKEN]); - * $class = new ClassUnderTest(); - * $result = $class->MyMethod(self::$phpcsFile, $stackPtr); - * // Or for static utility methods: - * $result = ClassUnderTest::MyMethod(self::$phpcsFile, $stackPtr); - * - * $this->assertSame($expected, $result); - * } - * - * /** - * * Data Provider. - * * - * * @see ClassUnderTestUnitTest::testMyMethod() For the array format. - * * - * * @return array - * * / - * public function dataMyMethod() - * { - * return array( - * array('/* testTestCaseDescription * /', false), - * ); - * } - * } - * ``` - * - * Note: - * - Remove the space between the comment closers `* /` for a working example. - * - Each test case separator comment MUST start with `/* test`. - * This is to allow the {@see UtilityMethodTestCase::getTargetToken()} method to - * distinquish between the test separation comments and comments which may be part - * of the test case. - * - The test case file and unit test file should be placed in the same directory. - * - For working examples using this abstract class, have a look at the unit tests - * for the PHPCSUtils utility functions themselves. - * - * @since 1.0.0 - */ -abstract class UtilityMethodTestCase extends TestCase -{ - - /** - * The PHPCS version the tests are being run on. - * - * @since 1.0.0-alpha3 - * - * @var string - */ - protected static $phpcsVersion = '0'; - - /** - * The file extension of the test case file (without leading dot). - * - * This allows concrete test classes to overrule the default `"inc"` with, for instance, - * `"js"` or `"css"` when applicable. - * - * @since 1.0.0 - * - * @var string - */ - protected static $fileExtension = 'inc'; - - /** - * Full path to the test case file associated with the concrete test class. - * - * Optional. If left empty, the case file will be presumed to be in - * the same directory and named the same as the test class, but with an - * `"inc"` file extension. - * - * @since 1.0.0 - * - * @var string - */ - protected static $caseFile = ''; - - /** - * The tab width setting to use when tokenizing the file. - * - * This allows for test case files to use a different tab width than the default. - * - * @since 1.0.0 - * - * @var int - */ - protected static $tabWidth = 4; - - /** - * The \PHP_CodeSniffer\Files\File object containing the parsed contents of the test case file. - * - * @since 1.0.0 - * - * @var \PHP_CodeSniffer\Files\File - */ - protected static $phpcsFile; - - /** - * Set the name of a sniff to pass to PHPCS to limit the run (and force it to record errors). - * - * Normally, this propery won't need to be overloaded, but for utility methods which record - * violations and contain fixers, setting a dummy sniff name equal to the sniff name passed - * in the error code for `addError()`/`addWarning()` during the test, will allow for testing - * the recording of these violations, as well as testing the fixer. - * - * @since 1.0.0 - * - * @var array - */ - protected static $selectedSniff = ['Dummy.Dummy.Dummy']; - - /** - * Initialize PHPCS & tokenize the test case file. - * - * The test case file for a unit test class has to be in the same directory - * directory and use the same file name as the test class, using the `.inc` extension - * or be explicitly set using the {@see UtilityMethodTestCase::$fileExtension}/ - * {@see UtilityMethodTestCase::$caseFile} properties. - * - * Note: This is a PHPUnit cross-version compatible {@see \PHPUnit\Framework\TestCase::setUpBeforeClass()} - * method. - * - * @since 1.0.0 - * - * @beforeClass - * - * @return void - */ - public static function setUpTestFile() - { - parent::setUpBeforeClass(); - - self::$phpcsVersion = Helper::getVersion(); - - $caseFile = static::$caseFile; - if (\is_string($caseFile) === false || $caseFile === '') { - $testClass = \get_called_class(); - $testFile = (new ReflectionClass($testClass))->getFileName(); - $caseFile = \substr($testFile, 0, -3) . static::$fileExtension; - } - - if (\is_readable($caseFile) === false) { - parent::fail("Test case file missing. Expected case file location: $caseFile"); - } - - $contents = \file_get_contents($caseFile); - - if (\version_compare(self::$phpcsVersion, '2.99.99', '>')) { - // PHPCS 3.x. - $config = new \PHP_CodeSniffer\Config(); - - /* - * We just need to provide a standard so PHPCS will tokenize the file. - * The standard itself doesn't actually matter for testing utility methods, - * so use the smallest one to get the fastest results. - */ - $config->standards = ['PSR1']; - - /* - * Limiting the run to just one sniff will make it, yet again, slightly faster. - * Picked the simplest/fastest sniff available which is registered in PSR1. - */ - $config->sniffs = static::$selectedSniff; - - // Disable caching. - $config->cache = false; - - // Also set a tab-width to enable testing tab-replaced vs `orig_content`. - $config->tabWidth = static::$tabWidth; - - $ruleset = new \PHP_CodeSniffer\Ruleset($config); - - // Make sure the file gets parsed correctly based on the file type. - $contents = 'phpcs_input_file: ' . $caseFile . \PHP_EOL . $contents; - - self::$phpcsFile = new \PHP_CodeSniffer\Files\DummyFile($contents, $ruleset, $config); - - // Only tokenize the file, do not process it. - try { - self::$phpcsFile->parse(); - } catch (TokenizerException $e) { - // PHPCS 3.5.0 and higher. - } catch (RuntimeException $e) { - // PHPCS 3.0.0 < 3.5.0. - } - } else { - // PHPCS 2.x. - $phpcs = new \PHP_CodeSniffer(null, static::$tabWidth); - self::$phpcsFile = new \PHP_CodeSniffer_File( - $caseFile, - [], - [], - $phpcs - ); - - /* - * Using error silencing to drown out "undefined index" notices for tokenizer - * issues in PHPCS 2.x which won't get fixed anymore anyway. - */ - @self::$phpcsFile->start($contents); - } - - // Fail the test if the case file failed to tokenize. - if (self::$phpcsFile->numTokens === 0) { - parent::fail("Tokenizing of the test case file failed for case file: $caseFile"); - } - } - - /** - * Skip JS and CSS related tests on PHPCS 4.x. - * - * PHPCS 4.x drops support for the JS and CSS tokenizers. - * This method takes care of automatically skipping tests involving JS/CSS case files - * when the tests are being run with PHPCS 4.x. - * - * Note: This is a PHPUnit cross-version compatible {@see \PHPUnit\Framework\TestCase::setUp()} - * method. - * - * @since 1.0.0-alpha3 - * - * @before - * - * @return void - */ - public function skipJSCSSTestsOnPHPCS4() - { - if (static::$fileExtension !== 'js' && static::$fileExtension !== 'css') { - return; - } - - if (\version_compare(self::$phpcsVersion, '3.99.99', '<=')) { - return; - } - - $this->markTestSkipped('JS and CSS support has been removed in PHPCS 4.'); - } - - /** - * Clean up after finished test. - * - * Note: This is a PHPUnit cross-version compatible {@see \PHPUnit\Framework\TestCase::tearDownAfterClass()} - * method. - * - * @since 1.0.0 - * - * @afterClass - * - * @return void - */ - public static function resetTestFile() - { - self::$phpcsFile = null; - } - - /** - * Check whether or not the PHP 8.0 identifier name tokens will be in use. - * - * The expected token positions/token counts for certain tokens will differ depending - * on whether the PHP 8.0 identifier name tokenization is used or the PHP < 8.0 - * identifier name tokenization. - * - * Tests can use this method to determine which flavour of tokenization to expect and - * to set test expectations accordingly. - * - * @codeCoverageIgnore Nothing to test. - * - * @since 1.0.0 - * - * @return bool - */ - public static function usesPhp8NameTokens() - { - $version = Helper::getVersion(); - if ((\version_compare(\PHP_VERSION_ID, '80000', '>=') === true - && \version_compare($version, '3.5.7', '<') === true) - || \version_compare($version, '4.0.0', '>=') === true - ) { - return true; - } - - return false; - } - - /** - * Get the token pointer for a target token based on a specific comment. - * - * Note: the test delimiter comment MUST start with `/* test` to allow this function to - * distinguish between comments used *in* a test and test delimiters. - * - * If the delimiter comment is not found, the test will automatically be failed. - * - * @since 1.0.0 - * - * @param string $commentString The complete delimiter comment to look for as a string. - * This string should include the comment opener and closer. - * @param int|string|array $tokenType The type of token(s) to look for. - * @param string $tokenContent Optional. The token content for the target token. - * @param bool $failTest Optional. Whether the test should be marked as failed when - * the target token cannot be found. Defaults to `true`. - * When set to `false`, a catchable PHP native `RuntimeException` - * will be thrown instead. - * - * @return int - * - * @throws \RuntimeException When the target token cannot be found and `$failTest` has been set to `false`. - */ - public function getTargetToken($commentString, $tokenType, $tokenContent = null, $failTest = true) - { - $start = (self::$phpcsFile->numTokens - 1); - $comment = self::$phpcsFile->findPrevious( - \T_COMMENT, - $start, - null, - false, - $commentString - ); - - if ($comment === false) { - $msg = 'Failed to find the test marker: ' . $commentString; - $this->fail($msg); - } - - $tokens = self::$phpcsFile->getTokens(); - $end = ($start + 1); - - // Limit the token finding to between this and the next delimiter comment. - for ($i = ($comment + 1); $i < $end; $i++) { - if ($tokens[$i]['code'] !== \T_COMMENT) { - continue; - } - - if (\stripos($tokens[$i]['content'], '/* test') === 0) { - $end = $i; - break; - } - } - - $target = self::$phpcsFile->findNext( - $tokenType, - ($comment + 1), - $end, - false, - $tokenContent - ); - - if ($target === false) { - $msg = 'Failed to find test target token for comment string: ' . $commentString; - if ($tokenContent !== null) { - $msg .= ' With token content: ' . $tokenContent; - } - - if ($failTest === false) { - throw new PHPRuntimeException($msg); - } - - $this->fail($msg); - } - - return $target; - } - - /** - * Helper method to tell PHPUnit to expect a PHPCS Exception in a PHPUnit and PHPCS cross-version - * compatible manner. - * - * @since 1.0.0 - * - * @param string $msg The expected exception message. - * @param string $type The PHPCS native exception type to expect. Either 'runtime' or 'tokenizer'. - * Defaults to 'runtime'. - * - * @return void - */ - public function expectPhpcsException($msg, $type = 'runtime') - { - $exception = 'PHP_CodeSniffer\Exceptions\RuntimeException'; - if ($type === 'tokenizer') { - $exception = 'PHP_CodeSniffer\Exceptions\TokenizerException'; - } - - if (\method_exists($this, 'expectException')) { - // PHPUnit 5+. - $this->expectException($exception); - $this->expectExceptionMessage($msg); - } else { - // PHPUnit 4. - $this->setExpectedException($exception, $msg); - } - } -} diff --git a/Magento2/Helpers/PHPCSUtils/Tokens/Collections.php b/Magento2/Helpers/PHPCSUtils/Tokens/Collections.php deleted file mode 100644 index bc8e30a4..00000000 --- a/Magento2/Helpers/PHPCSUtils/Tokens/Collections.php +++ /dev/null @@ -1,369 +0,0 @@ - => - */ - public static $magicConstants = [ - \T_CLASS_C => \T_CLASS_C, - \T_DIR => \T_DIR, - \T_FILE => \T_FILE, - \T_FUNC_C => \T_FUNC_C, - \T_LINE => \T_LINE, - \T_METHOD_C => \T_METHOD_C, - \T_NS_C => \T_NS_C, - \T_TRAIT_C => \T_TRAIT_C, - ]; - - /** - * Object operators. - * - * @since 1.0.0-alpha3 - * - * @var array => - */ - public static $objectOperators = [ - \T_OBJECT_OPERATOR => \T_OBJECT_OPERATOR, - \T_DOUBLE_COLON => \T_DOUBLE_COLON, - ]; - - /** - * Tokens types used for "forwarding" calls within OO structures. - * - * @link https://www.php.net/language.oop5.paamayim-nekudotayim PHP Manual on OO forwarding calls - * - * @since 1.0.0-alpha3 - * - * @var array => - */ - public static $OOHierarchyKeywords = [ - \T_PARENT => \T_PARENT, - \T_SELF => \T_SELF, - \T_STATIC => \T_STATIC, - ]; - - /** - * List of tokens which represent "closed" scopes. - * - * I.e. anything declared within that scope - except for other closed scopes - is - * outside of the global namespace. - * - * This list doesn't contain the `T_NAMESPACE` token on purpose as variables declared - * within a namespace scope are still global and not limited to that namespace. - * - * @since 1.0.0 - * - * @var array => - */ - public static $closedScopes = [ - \T_CLASS => \T_CLASS, - \T_ANON_CLASS => \T_ANON_CLASS, - \T_INTERFACE => \T_INTERFACE, - \T_TRAIT => \T_TRAIT, - \T_FUNCTION => \T_FUNCTION, - \T_CLOSURE => \T_CLOSURE, - ]; - - /** - * OO structures which can use the "extends" keyword. - * - * @since 1.0.0 - * - * @var array => - */ - public static $OOCanExtend = [ - \T_CLASS => \T_CLASS, - \T_ANON_CLASS => \T_ANON_CLASS, - \T_INTERFACE => \T_INTERFACE, - ]; - - /** - * Tokens which can start a - potentially multi-line - text string. - * - * @since 1.0.0 - * - * @var array => - */ - public static $textStingStartTokens = [ - \T_START_HEREDOC => \T_START_HEREDOC, - \T_START_NOWDOC => \T_START_NOWDOC, - \T_CONSTANT_ENCAPSED_STRING => \T_CONSTANT_ENCAPSED_STRING, - \T_DOUBLE_QUOTED_STRING => \T_DOUBLE_QUOTED_STRING, - ]; - - /** - * Tokens which can represent the arrow function keyword. - * - * Note: this is a method, not a property as the `T_FN` token for arrow functions may not exist. - * - * @since 1.0.0-alpha2 - * - * @return array => - */ - public static function arrowFunctionTokensBC() - { - $tokens = [ - \T_STRING => \T_STRING, - ]; - - if (\defined('T_FN') === true) { - // PHP 7.4 or PHPCS 3.5.3+. - $tokens[\T_FN] = \T_FN; - } - - return $tokens; - } - - /** - * Tokens which can represent a keyword which starts a function declaration. - * - * Note: this is a method, not a property as the `T_FN` token for arrow functions may not exist. - * - * Sister-method to the {@see Collections::functionDeclarationTokensBC()} method. - * This method supports PHPCS 3.5.3 and up. - * The {@see Collections::functionDeclarationTokensBC()} method supports PHPCS 2.6.0 and up. - * - * @see \PHPCSUtils\Tokens\Collections::functionDeclarationTokensBC() Related method (PHPCS 2.6.0+). - * - * @since 1.0.0-alpha3 - * - * @return array => - */ - public static function functionDeclarationTokens() - { - $tokens = [ - \T_FUNCTION => \T_FUNCTION, - \T_CLOSURE => \T_CLOSURE, - ]; - - if (\defined('T_FN') === true) { - // PHP 7.4 or PHPCS 3.5.3+. - $tokens[\T_FN] = \T_FN; - } - - return $tokens; - } - - /** - * Tokens which can represent a keyword which starts a function declaration. - * - * Note: this is a method, not a property as the `T_FN` token for arrow functions may not exist. - * - * Sister-method to the {@see Collections::functionDeclarationTokens()} method. - * The {@see Collections::functionDeclarationTokens()} method supports PHPCS 3.5.3 and up. - * This method supports PHPCS 2.6.0 and up. - * - * Notable difference: - * - This method accounts for when the `T_FN` token doesn't exist. - * - * Note: if this method is used, the {@see \PHPCSUtils\Utils\FunctionDeclarations::isArrowFunction()} - * method needs to be used on arrow function tokens to verify whether it really is an arrow function - * declaration or not. - * - * It is recommended to use the {@see Collections::functionDeclarationTokens()} method instead of - * this method if a standard supports does not need to support PHPCS < 3.5.3. - * - * @see \PHPCSUtils\Tokens\Collections::functionDeclarationTokens() Related method (PHPCS 3.5.3+). - * @see \PHPCSUtils\Utils\FunctionDeclarations::isArrowFunction() Arrow function verification. - * - * @since 1.0.0-alpha3 - * - * @return array => - */ - public static function functionDeclarationTokensBC() - { - $tokens = [ - \T_FUNCTION => \T_FUNCTION, - \T_CLOSURE => \T_CLOSURE, - ]; - - $tokens += self::arrowFunctionTokensBC(); - - return $tokens; - } - - /** - * The tokens used for "names", be it namespace, OO, function or constant names. - * - * Includes the tokens introduced in PHP 8.0 for "Namespaced names as single token" when available. - * - * Note: this is a method, not a property as the PHP 8.0 identifier name tokens may not exist. - * - * @link https://wiki.php.net/rfc/namespaced_names_as_token - * - * @since 1.0.0-alpha4 - * - * @return array => - */ - public static function nameTokens() - { - $tokens = [ - \T_STRING => \T_STRING, - ]; - - /* - * PHP >= 8.0 in combination with PHPCS < 3.5.7 and all PHP versions in combination - * with PHPCS >= 3.5.7, though when using PHPCS 3.5.7 < 4.0.0, these tokens are - * not yet in use, i.e. the PHP 8.0 change is "undone" for PHPCS 3.x. - */ - if (\defined('T_NAME_QUALIFIED') === true) { - $tokens[\T_NAME_QUALIFIED] = \T_NAME_QUALIFIED; - } - - if (\defined('T_NAME_FULLY_QUALIFIED') === true) { - $tokens[\T_NAME_FULLY_QUALIFIED] = \T_NAME_FULLY_QUALIFIED; - } - - if (\defined('T_NAME_RELATIVE') === true) { - $tokens[\T_NAME_RELATIVE] = \T_NAME_RELATIVE; - } - - return $tokens; - } - - /** - * Tokens types which can be encountered in a fully, partially or unqualified name. - * - * Example: - * ```php - * echo namespace\Sub\ClassName::method(); - * ``` - * - * @since 1.0.0-alpha4 - * - * @return array => - */ - public static function namespacedNameTokens() - { - $tokens = [ - \T_NS_SEPARATOR => \T_NS_SEPARATOR, - \T_NAMESPACE => \T_NAMESPACE, - ]; - - $tokens += self::nameTokens(); - - return $tokens; - } - /** - * Token types which can be encountered in a return type declaration. - * - * Note: this is a method, not a property as the `T_TYPE_UNION` token for PHP 8.0 union types may not exist. - * - * Sister-method to the {@see Collections::returnTypeTokensBC()} method. - * This method supports PHPCS 3.3.0 and up. - * The {@see Collections::returnTypeTokensBC()} method supports PHPCS 2.6.0 and up. - * - * Notable differences: - * - The {@see Collections::returnTypeTokensBC()} method will include the `T_ARRAY_HINT` - * and the `T_RETURN_TYPE` tokens when used with PHPCS 2.x and 3.x. - * These token constants will no longer exist in PHPCS 4.x. - * - * It is recommended to use this method instead of the {@see Collections::returnTypeTokensBC()} - * method if a standard does not need to support PHPCS < 3.3.0. - * - * @see \PHPCSUtils\Tokens\Collections::returnTypeTokensBC() Related method (cross-version). - * - * @since 1.0.0-alpha4 This method replaces the {@see Collections::$returnTypeTokens} property. - * @since 1.0.0-alpha4 Added support for PHP 8.0 union types. - * @since 1.0.0-alpha4 Added support for PHP 8.0 identifier name tokens. - * @since 1.0.0-alpha4 Added the T_TYPE_UNION token for union type support in PHPCS > 3.6.0. - * - * @return array => - */ - public static function returnTypeTokens() - { - $tokens = [ - \T_CALLABLE => \T_CALLABLE, - \T_SELF => \T_SELF, - \T_PARENT => \T_PARENT, - \T_STATIC => \T_STATIC, - \T_FALSE => \T_FALSE, // Union types only. - \T_NULL => \T_NULL, // Union types only. - \T_ARRAY => \T_ARRAY, // Arrow functions PHPCS < 3.5.4 + union types. - \T_BITWISE_OR => \T_BITWISE_OR, // Union types for PHPCS < 3.6.0. - ]; - - $tokens += self::namespacedNameTokens(); - - // PHPCS > 3.6.0: a new token was introduced for the union type separator. - if (\defined('T_TYPE_UNION') === true) { - $tokens[\T_TYPE_UNION] = \T_TYPE_UNION; - } - - return $tokens; - } - - /** - * Token types which can be encountered in a return type declaration (cross-version). - * - * Sister-method to the {@see Collections::returnTypeTokens()} method. - * The {@see Collections::returnTypeTokens()} method supports PHPCS 3.3.0 and up. - * This method supports PHPCS 2.6.0 and up. - * - * Notable differences: - * - This method will include the `T_ARRAY_HINT` and the `T_RETURN_TYPE` tokens when - * used with PHPCS 2.x and 3.x. - * These token constants will no longer exist in PHPCS 4.x. - * - * It is recommended to use the {@see Collections::returnTypeTokens()} method instead of - * this method if a standard does not need to support PHPCS < 3.3.0. - * - * @see \PHPCSUtils\Tokens\Collections::returnTypeTokens() Related method (PHPCS 3.3.0+). - * - * @since 1.0.0-alpha3 - * @since 1.0.0-alpha4 Added support for PHP 8.0 union types. - * @since 1.0.0-alpha4 Added support for PHP 8.0 identifier name tokens. - * - * @return array => - */ - public static function returnTypeTokensBC() - { - $tokens = self::returnTypeTokens(); - - /* - * PHPCS < 4.0. Needed for support of PHPCS 2.4.0 < 3.3.0. - * For PHPCS 3.3.0+ the constant is no longer used. - */ - if (\defined('T_RETURN_TYPE') === true) { - $tokens[\T_RETURN_TYPE] = \T_RETURN_TYPE; - } - - /* - * PHPCS < 4.0. Needed for support of PHPCS < 2.8.0 / PHPCS < 3.5.3 for arrow functions. - * For PHPCS 3.5.3+ the constant is no longer used. - */ - if (\defined('T_ARRAY_HINT') === true) { - $tokens[\T_ARRAY_HINT] = \T_ARRAY_HINT; - } - - return $tokens; - } -} diff --git a/Magento2/Helpers/PHPCSUtils/Utils/Conditions.php b/Magento2/Helpers/PHPCSUtils/Utils/Conditions.php deleted file mode 100644 index 4d34ed92..00000000 --- a/Magento2/Helpers/PHPCSUtils/Utils/Conditions.php +++ /dev/null @@ -1,119 +0,0 @@ -getTokens(); - - // Check for the existence of the token. - if (isset($tokens[$stackPtr]) === false) { - return false; - } - - // Make sure the token has conditions. - if (empty($tokens[$stackPtr]['conditions'])) { - return false; - } - - $types = (array) $types; - $conditions = $tokens[$stackPtr]['conditions']; - - if (empty($types) === true) { - // No types specified, just return the first/last condition pointer. - if ($first === false) { - \end($conditions); - } else { - \reset($conditions); - } - - return \key($conditions); - } - - if ($first === false) { - $conditions = \array_reverse($conditions, true); - } - - foreach ($conditions as $ptr => $type) { - if (isset($tokens[$ptr]) === true - && \in_array($type, $types, true) === true - ) { - // We found a token with the required type. - return $ptr; - } - } - - return false; - } - - /** - * Return the position of the last (innermost) condition of a certain type for the passed token. - * - * If no types are specified, the last condition for the token, independently of type, - * will be returned. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position of the token we are checking. - * @param int|string|array $types Optional. The type(s) of tokens to search for. - * - * @return int|false Integer stack pointer to the condition; or `FALSE` if the token - * does not have the condition or has no conditions at all. - */ - public static function getLastCondition(File $phpcsFile, $stackPtr, $types = []) - { - return self::getCondition($phpcsFile, $stackPtr, $types, false); - } -} diff --git a/Magento2/Helpers/PHPCSUtils/Utils/FunctionDeclarations.php b/Magento2/Helpers/PHPCSUtils/Utils/FunctionDeclarations.php deleted file mode 100644 index 94641d48..00000000 --- a/Magento2/Helpers/PHPCSUtils/Utils/FunctionDeclarations.php +++ /dev/null @@ -1,754 +0,0 @@ - 'public', // Public, private, or protected - * 'scope_specified' => true, // TRUE if the scope keyword was found. - * 'return_type' => '', // The return type of the method. - * 'return_type_token' => integer, // The stack pointer to the start of the return type - * // or FALSE if there is no return type. - * 'return_type_end_token' => integer, // The stack pointer to the end of the return type - * // or FALSE if there is no return type. - * 'nullable_return_type' => false, // TRUE if the return type is nullable. - * 'is_abstract' => false, // TRUE if the abstract keyword was found. - * 'is_final' => false, // TRUE if the final keyword was found. - * 'is_static' => false, // TRUE if the static keyword was found. - * 'has_body' => false, // TRUE if the method has a body - * ); - * ``` - * - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a T_FUNCTION - * or T_CLOSURE token, nor an arrow function. - */ - public static function getProperties(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $arrowOpenClose = self::getArrowFunctionOpenClose($phpcsFile, $stackPtr); - - if (isset($tokens[$stackPtr]) === false - || ($tokens[$stackPtr]['code'] !== \T_FUNCTION - && $tokens[$stackPtr]['code'] !== \T_CLOSURE - && $arrowOpenClose === false) - ) { - throw new RuntimeException('$stackPtr must be of type T_FUNCTION or T_CLOSURE or an arrow function'); - } - - if ($tokens[$stackPtr]['code'] === \T_FUNCTION) { - $valid = Tokens::$methodPrefixes; - } else { - $valid = [\T_STATIC => \T_STATIC]; - } - - $valid += Tokens::$emptyTokens; - - $scope = 'public'; - $scopeSpecified = false; - $isAbstract = false; - $isFinal = false; - $isStatic = false; - - for ($i = ($stackPtr - 1); $i > 0; $i--) { - if (isset($valid[$tokens[$i]['code']]) === false) { - break; - } - - switch ($tokens[$i]['code']) { - case \T_PUBLIC: - $scope = 'public'; - $scopeSpecified = true; - break; - case \T_PRIVATE: - $scope = 'private'; - $scopeSpecified = true; - break; - case \T_PROTECTED: - $scope = 'protected'; - $scopeSpecified = true; - break; - case \T_ABSTRACT: - $isAbstract = true; - break; - case \T_FINAL: - $isFinal = true; - break; - case \T_STATIC: - $isStatic = true; - break; - } - } - - $returnType = ''; - $returnTypeToken = false; - $returnTypeEndToken = false; - $nullableReturnType = false; - $hasBody = false; - $returnTypeTokens = Collections::returnTypeTokensBC(); - - $parenthesisCloser = null; - if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { - $parenthesisCloser = $tokens[$stackPtr]['parenthesis_closer']; - } elseif ($arrowOpenClose !== false) { - // Arrow function in combination with PHP < 7.4 or PHPCS < 3.5.3. - $parenthesisCloser = $arrowOpenClose['parenthesis_closer']; - } - - if (isset($parenthesisCloser) === true) { - $scopeOpener = null; - if (isset($tokens[$stackPtr]['scope_opener']) === true) { - $scopeOpener = $tokens[$stackPtr]['scope_opener']; - } elseif ($arrowOpenClose !== false) { - // Arrow function in combination with PHP < 7.4 or PHPCS < 3.5.3. - $scopeOpener = $arrowOpenClose['scope_opener']; - } - - for ($i = $parenthesisCloser; $i < $phpcsFile->numTokens; $i++) { - if ($i === $scopeOpener) { - // End of function definition. - $hasBody = true; - break; - } - - if ($scopeOpener === null && $tokens[$i]['code'] === \T_SEMICOLON) { - // End of abstract/interface function definition. - break; - } - - if ($tokens[$i]['type'] === 'T_NULLABLE' - // Handle nullable tokens in PHPCS < 2.8.0. - || (\defined('T_NULLABLE') === false && $tokens[$i]['code'] === \T_INLINE_THEN) - // Handle nullable tokens with arrow functions in PHPCS 2.8.0 - 2.9.0. - || ($arrowOpenClose !== false && $tokens[$i]['code'] === \T_INLINE_THEN - && \version_compare(Helper::getVersion(), '2.9.1', '<') === true) - ) { - $nullableReturnType = true; - } - - if (isset($returnTypeTokens[$tokens[$i]['code']]) === true) { - if ($returnTypeToken === false) { - $returnTypeToken = $i; - } - - $returnType .= $tokens[$i]['content']; - $returnTypeEndToken = $i; - } - } - } - - if ($returnType !== '' && $nullableReturnType === true) { - $returnType = '?' . $returnType; - } - - return [ - 'scope' => $scope, - 'scope_specified' => $scopeSpecified, - 'return_type' => $returnType, - 'return_type_token' => $returnTypeToken, - 'return_type_end_token' => $returnTypeEndToken, - 'nullable_return_type' => $nullableReturnType, - 'is_abstract' => $isAbstract, - 'is_final' => $isFinal, - 'is_static' => $isStatic, - 'has_body' => $hasBody, - ]; - } - - /** - * Retrieve the parenthesis opener, parenthesis closer, the scope opener and the scope closer - * for an arrow function. - * - * Helper function for cross-version compatibility with both PHP as well as PHPCS. - * In PHPCS versions prior to PHPCS 3.5.3/3.5.4, the `T_FN` token is not yet backfilled - * and does not have parenthesis opener/closer nor scope opener/closer indexes assigned - * in the `$tokens` array. - * - * @see \PHPCSUtils\Utils\FunctionDeclarations::isArrowFunction() Related function. - * - * @since 1.0.0 - * @since 1.0.0-alpha4 Handling of PHP 8.0 identifier name tokens in return types, cross-version PHP & PHPCS. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The token to retrieve the openers/closers for. - * Typically a `T_FN` or `T_STRING` token as those are the - * only two tokens which can be the arrow function keyword. - * - * @return array|false An array with the token pointers or `FALSE` if this is not an arrow function. - * The format of the return value is: - * ```php - * array( - * 'parenthesis_opener' => integer, // Stack pointer to the parenthesis opener. - * 'parenthesis_closer' => integer, // Stack pointer to the parenthesis closer. - * 'scope_opener' => integer, // Stack pointer to the scope opener (arrow). - * 'scope_closer' => integer, // Stack pointer to the scope closer. - * ) - * ``` - */ - public static function getArrowFunctionOpenClose(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]) === false - || isset(Collections::arrowFunctionTokensBC()[$tokens[$stackPtr]['code']]) === false - || \strtolower($tokens[$stackPtr]['content']) !== 'fn' - ) { - return false; - } - - if ($tokens[$stackPtr]['type'] === 'T_FN' - && isset($tokens[$stackPtr]['scope_closer']) === true - && \version_compare(Helper::getVersion(), '3.5.4', '>') === true - ) { - // The keys will either all be set or none will be set, so no additional checks needed. - return [ - 'parenthesis_opener' => $tokens[$stackPtr]['parenthesis_opener'], - 'parenthesis_closer' => $tokens[$stackPtr]['parenthesis_closer'], - 'scope_opener' => $tokens[$stackPtr]['scope_opener'], - 'scope_closer' => $tokens[$stackPtr]['scope_closer'], - ]; - } - - /* - * This is either a T_STRING token pre-PHP 7.4, or T_FN on PHP 7.4 in combination - * with PHPCS < 3.5.3/4/5. - * - * Now see about finding the relevant arrow function tokens. - */ - $returnValue = []; - - $nextNonEmpty = $phpcsFile->findNext( - (Tokens::$emptyTokens + [\T_BITWISE_AND]), - ($stackPtr + 1), - null, - true - ); - if ($nextNonEmpty === false || $tokens[$nextNonEmpty]['code'] !== \T_OPEN_PARENTHESIS) { - return false; - } - - $returnValue['parenthesis_opener'] = $nextNonEmpty; - if (isset($tokens[$nextNonEmpty]['parenthesis_closer']) === false) { - return false; - } - - $returnValue['parenthesis_closer'] = $tokens[$nextNonEmpty]['parenthesis_closer']; - - $ignore = Tokens::$emptyTokens; - $ignore += Collections::returnTypeTokensBC(); - $ignore[\T_COLON] = \T_COLON; - $ignore[\T_INLINE_ELSE] = \T_INLINE_ELSE; // Return type colon on PHPCS < 2.9.1. - $ignore[\T_INLINE_THEN] = \T_INLINE_THEN; // Nullable type indicator on PHPCS < 2.9.1. - - if (\defined('T_NULLABLE') === true) { - $ignore[\T_NULLABLE] = \T_NULLABLE; - } - - $arrow = $phpcsFile->findNext( - $ignore, - ($tokens[$nextNonEmpty]['parenthesis_closer'] + 1), - null, - true - ); - - if ($arrow === false - || ($tokens[$arrow]['code'] !== \T_DOUBLE_ARROW && $tokens[$arrow]['type'] !== 'T_FN_ARROW') - ) { - return false; - } - - $returnValue['scope_opener'] = $arrow; - $inTernary = false; - $lastEndToken = null; - - for ($scopeCloser = ($arrow + 1); $scopeCloser < $phpcsFile->numTokens; $scopeCloser++) { - if (isset(self::$arrowFunctionEndTokens[$tokens[$scopeCloser]['code']]) === true - // BC for misidentified ternary else in some PHPCS versions. - && ($tokens[$scopeCloser]['code'] !== \T_COLON || $inTernary === false) - ) { - if ($lastEndToken !== null - && $tokens[$scopeCloser]['code'] === \T_CLOSE_PARENTHESIS - && $tokens[$scopeCloser]['parenthesis_opener'] < $arrow - ) { - $scopeCloser = $lastEndToken; - } - - break; - } - - if (isset(Collections::arrowFunctionTokensBC()[$tokens[$scopeCloser]['code']]) === true) { - $nested = self::getArrowFunctionOpenClose($phpcsFile, $scopeCloser); - if ($nested !== false && isset($nested['scope_closer'])) { - // We minus 1 here in case the closer can be shared with us. - $scopeCloser = ($nested['scope_closer'] - 1); - continue; - } - } - - if (isset($tokens[$scopeCloser]['scope_closer']) === true - && $tokens[$scopeCloser]['code'] !== \T_INLINE_ELSE - && $tokens[$scopeCloser]['code'] !== \T_END_HEREDOC - && $tokens[$scopeCloser]['code'] !== \T_END_NOWDOC - ) { - // We minus 1 here in case the closer can be shared with us. - $scopeCloser = ($tokens[$scopeCloser]['scope_closer'] - 1); - continue; - } - - if (isset($tokens[$scopeCloser]['parenthesis_closer']) === true) { - $scopeCloser = $tokens[$scopeCloser]['parenthesis_closer']; - $lastEndToken = $scopeCloser; - continue; - } - - if (isset($tokens[$scopeCloser]['bracket_closer']) === true) { - $scopeCloser = $tokens[$scopeCloser]['bracket_closer']; - $lastEndToken = $scopeCloser; - continue; - } - - if ($tokens[$scopeCloser]['code'] === \T_INLINE_THEN) { - $inTernary = true; - continue; - } - - if ($tokens[$scopeCloser]['code'] === \T_INLINE_ELSE) { - if ($inTernary === false) { - break; - } - - $inTernary = false; - } - } - - if ($scopeCloser === $phpcsFile->numTokens) { - return false; - } - - $returnValue['scope_closer'] = $scopeCloser; - - return $returnValue; - } - - /** - * Returns the declaration name for a function. - * - * Alias for the {@see \PHPCSUtils\Utils\ObjectDeclarations::getName()} method. - * - * @see \PHPCSUtils\BackCompat\BCFile::getDeclarationName() Original function. - * @see \PHPCSUtils\Utils\ObjectDeclarations::getName() PHPCSUtils native improved version. - * - * @since 1.0.0 - * - * @codeCoverageIgnore - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the function keyword token. - * - * @return string|null The name of the function; or `NULL` if the passed token doesn't exist, - * the function is anonymous or in case of a parse error/live coding. - * - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified token is not of type - * `T_FUNCTION`. - */ - public static function getName(File $phpcsFile, $stackPtr) - { - return ObjectDeclarations::getName($phpcsFile, $stackPtr); - } - - - /** - * Retrieves the method parameters for the specified function token. - * - * Also supports passing in a `T_USE` token for a closure use group. - * - * The returned array will contain the following information for each parameter: - * - * ```php - * 0 => array( - * 'name' => '$var', // The variable name. - * 'token' => integer, // The stack pointer to the variable name. - * 'content' => string, // The full content of the variable definition. - * 'pass_by_reference' => boolean, // Is the variable passed by reference? - * 'reference_token' => integer, // The stack pointer to the reference operator - * // or FALSE if the param is not passed by reference. - * 'variable_length' => boolean, // Is the param of variable length through use of `...` ? - * 'variadic_token' => integer, // The stack pointer to the ... operator - * // or FALSE if the param is not variable length. - * 'type_hint' => string, // The type hint for the variable. - * 'type_hint_token' => integer, // The stack pointer to the start of the type hint - * // or FALSE if there is no type hint. - * 'type_hint_end_token' => integer, // The stack pointer to the end of the type hint - * // or FALSE if there is no type hint. - * 'nullable_type' => boolean, // TRUE if the var type is preceded by the nullability - * // operator. - * 'comma_token' => integer, // The stack pointer to the comma after the param - * // or FALSE if this is the last param. - * ) - * ``` - * - * Parameters with default values have the following additional array indexes: - * ```php - * 'default' => string, // The full content of the default value. - * 'default_token' => integer, // The stack pointer to the start of the default value. - * 'default_equal_token' => integer, // The stack pointer to the equals sign. - * ``` - * - * Parameters declared using PHP 8 constructor property promotion, have these additional array indexes: - * ```php - * 'property_visibility' => string, // The property visibility as declared. - * 'visibility_token' => integer, // The stack pointer to the visibility modifier token. - * ``` - * - * Main differences with the PHPCS version: - * - Defensive coding against incorrect calls to this method. - * - More efficient and more stable checking whether a `T_USE` token is a closure use. - * - More efficient and more stable looping of the default value. - * - Clearer exception message when a non-closure use token was passed to the function. - * - To allow for backward compatible handling of arrow functions, this method will also accept - * `T_STRING` tokens and examine them to check if these are arrow functions. - * - Support for PHP 8.0 identifier name tokens in parameter types, cross-version PHP & PHPCS. - * - * @see \PHP_CodeSniffer\Files\File::getMethodParameters() Original source. - * @see \PHPCSUtils\BackCompat\BCFile::getMethodParameters() Cross-version compatible version of the original. - * - * @since 1.0.0 - * @since 1.0.0-alpha2 Added BC support for PHP 7.4 arrow functions. - * @since 1.0.0-alpha4 Added support for PHP 8.0 union types. - * @since 1.0.0-alpha4 Added support for PHP 8.0 constructor property promotion. - * @since 1.0.0-alpha4 Added support for PHP 8.0 identifier name tokenization. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position in the stack of the function token - * to acquire the parameters for. - * - * @return array - * - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified $stackPtr is not of - * type `T_FUNCTION`, `T_CLOSURE` or `T_USE`, - * nor an arrow function. - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If a passed `T_USE` token is not a closure - * use token. - */ - public static function getParameters(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - $arrowOpenClose = self::getArrowFunctionOpenClose($phpcsFile, $stackPtr); - - if (isset($tokens[$stackPtr]) === false - || ($tokens[$stackPtr]['code'] !== \T_FUNCTION - && $tokens[$stackPtr]['code'] !== \T_CLOSURE - && $tokens[$stackPtr]['code'] !== \T_USE - && $arrowOpenClose === false) - ) { - throw new RuntimeException('$stackPtr must be of type T_FUNCTION, T_CLOSURE or T_USE or an arrow function'); - } - - if ($tokens[$stackPtr]['code'] === \T_USE) { - // This will work PHPCS 3.x/4.x cross-version without much overhead. - $opener = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($opener === false - || $tokens[$opener]['code'] !== \T_OPEN_PARENTHESIS - || UseStatements::isClosureUse($phpcsFile, $stackPtr) === false - ) { - throw new RuntimeException('$stackPtr was not a valid closure T_USE'); - } - } elseif ($arrowOpenClose !== false) { - // Arrow function in combination with PHP < 7.4 or PHPCS < 3.5.3/4/5. - $opener = $arrowOpenClose['parenthesis_opener']; - } else { - if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) { - // Live coding or syntax error, so no params to find. - return []; - } - - $opener = $tokens[$stackPtr]['parenthesis_opener']; - } - - if (isset($tokens[$opener]['parenthesis_closer']) === false) { - // Live coding or syntax error, so no params to find. - return []; - } - - $closer = $tokens[$opener]['parenthesis_closer']; - - $vars = []; - $currVar = null; - $paramStart = ($opener + 1); - $defaultStart = null; - $equalToken = null; - $paramCount = 0; - $passByReference = false; - $referenceToken = false; - $variableLength = false; - $variadicToken = false; - $typeHint = ''; - $typeHintToken = false; - $typeHintEndToken = false; - $nullableType = false; - $visibilityToken = null; - - for ($i = $paramStart; $i <= $closer; $i++) { - // Changed from checking 'code' to 'type' to allow for T_NULLABLE not existing in PHPCS < 2.8.0. - switch ($tokens[$i]['type']) { - case 'T_BITWISE_AND': - $passByReference = true; - $referenceToken = $i; - break; - - case 'T_VARIABLE': - $currVar = $i; - break; - - case 'T_ELLIPSIS': - $variableLength = true; - $variadicToken = $i; - break; - - case 'T_ARRAY_HINT': // PHPCS < 3.3.0. - case 'T_CALLABLE': - case 'T_SELF': - case 'T_PARENT': - case 'T_STATIC': // Self and parent are valid, static invalid, but was probably intended as type hint. - case 'T_FALSE': // Union types. - case 'T_NULL': // Union types. - case 'T_STRING': - case 'T_NAMESPACE': - case 'T_NS_SEPARATOR': - case 'T_NAME_QUALIFIED': - case 'T_NAME_FULLY_QUALIFIED': - case 'T_NAME_RELATIVE': - case 'T_BITWISE_OR': // Union type separator PHPCS < 3.6.0. - case 'T_TYPE_UNION': // Union type separator PHPCS >= 3.6.0. - if ($typeHintToken === false) { - $typeHintToken = $i; - } - - $typeHint .= $tokens[$i]['content']; - $typeHintEndToken = $i; - break; - - case 'T_NULLABLE': - case 'T_INLINE_THEN': // PHPCS < 2.8.0. - $nullableType = true; - $typeHint .= $tokens[$i]['content']; - $typeHintEndToken = $i; - break; - - case 'T_PUBLIC': - case 'T_PROTECTED': - case 'T_PRIVATE': - $visibilityToken = $i; - break; - - case 'T_CLOSE_PARENTHESIS': - case 'T_COMMA': - // If it's null, then there must be no parameters for this - // method. - if ($currVar === null) { - continue 2; - } - - $vars[$paramCount] = []; - $vars[$paramCount]['token'] = $currVar; - $vars[$paramCount]['name'] = $tokens[$currVar]['content']; - $vars[$paramCount]['content'] = \trim( - GetTokensAsString::normal($phpcsFile, $paramStart, ($i - 1)) - ); - - if ($defaultStart !== null) { - $vars[$paramCount]['default'] = \trim( - GetTokensAsString::normal($phpcsFile, $defaultStart, ($i - 1)) - ); - $vars[$paramCount]['default_token'] = $defaultStart; - $vars[$paramCount]['default_equal_token'] = $equalToken; - } - - $vars[$paramCount]['pass_by_reference'] = $passByReference; - $vars[$paramCount]['reference_token'] = $referenceToken; - $vars[$paramCount]['variable_length'] = $variableLength; - $vars[$paramCount]['variadic_token'] = $variadicToken; - $vars[$paramCount]['type_hint'] = $typeHint; - $vars[$paramCount]['type_hint_token'] = $typeHintToken; - $vars[$paramCount]['type_hint_end_token'] = $typeHintEndToken; - $vars[$paramCount]['nullable_type'] = $nullableType; - - if ($visibilityToken !== null) { - $vars[$paramCount]['property_visibility'] = $tokens[$visibilityToken]['content']; - $vars[$paramCount]['visibility_token'] = $visibilityToken; - } - - if ($tokens[$i]['code'] === \T_COMMA) { - $vars[$paramCount]['comma_token'] = $i; - } else { - $vars[$paramCount]['comma_token'] = false; - } - - // Reset the vars, as we are about to process the next parameter. - $currVar = null; - $paramStart = ($i + 1); - $defaultStart = null; - $equalToken = null; - $passByReference = false; - $referenceToken = false; - $variableLength = false; - $variadicToken = false; - $typeHint = ''; - $typeHintToken = false; - $typeHintEndToken = false; - $nullableType = false; - $visibilityToken = null; - - $paramCount++; - break; - - case 'T_EQUAL': - $defaultStart = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true); - $equalToken = $i; - - // Skip past everything in the default value before going into the next switch loop. - for ($j = ($i + 1); $j <= $closer; $j++) { - // Skip past array()'s et al as default values. - if (isset($tokens[$j]['parenthesis_opener'], $tokens[$j]['parenthesis_closer'])) { - $j = $tokens[$j]['parenthesis_closer']; - - if ($j === $closer) { - // Found the end of the parameter. - break; - } - - continue; - } - - // Skip past short arrays et al as default values. - if (isset($tokens[$j]['bracket_opener'])) { - $j = $tokens[$j]['bracket_closer']; - continue; - } - - if ($tokens[$j]['code'] === \T_COMMA) { - break; - } - } - - $i = ($j - 1); - break; - } - } - - return $vars; - } - - /** - * Check if an arbitrary token is the "fn" keyword for a PHP 7.4 arrow function. - * - * Helper function for cross-version compatibility with both PHP as well as PHPCS. - * - PHP 7.4+ will tokenize most tokens with the content "fn" as `T_FN`, even when it isn't an arrow function. - * - PHPCS < 3.5.3 will tokenize arrow functions keywords as `T_STRING`. - * - PHPCS 3.5.3/3.5.4 will tokenize the keyword differently depending on which PHP version is used - * and similar to PHP will tokenize most tokens with the content "fn" as `T_FN`, even when it's not an - * arrow function. - * > Note: the tokens tokenized by PHPCS 3.5.3 - 3.5.4 as `T_FN` are not 100% the same as those tokenized - * by PHP 7.4+ as `T_FN`. - * - * Either way, the `T_FN` token is not a reliable search vector for finding or examining - * arrow functions, at least not until PHPCS 3.5.5. - * This function solves that and will give reliable results in the same way as this is now - * solved in PHPCS 3.5.5. - * - * > Note: Bugs are still being found and reported about how PHPCS tokenizes the arrow functions. - * This method will keep up with upstream changes and backport them, in as far possible, to allow - * for sniffing arrow functions in PHPCS < current. - * - * @see \PHPCSUtils\Utils\FunctionDeclarations::getArrowFunctionOpenClose() Related function. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The token to check. Typically a T_FN or - * T_STRING token as those are the only two - * tokens which can be the arrow function keyword. - * - * @return bool `TRUE` if the token is the "fn" keyword for an arrow function. `FALSE` when it's not - * or in case of live coding/parse error. - */ - public static function isArrowFunction(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]) === false) { - return false; - } - - if ($tokens[$stackPtr]['type'] === 'T_FN' - && isset($tokens[$stackPtr]['scope_closer']) === true - ) { - return true; - } - - if (isset(Collections::arrowFunctionTokensBC()[$tokens[$stackPtr]['code']]) === false - || \strtolower($tokens[$stackPtr]['content']) !== 'fn' - ) { - return false; - } - - $openClose = self::getArrowFunctionOpenClose($phpcsFile, $stackPtr); - if ($openClose !== false && isset($openClose['scope_closer'])) { - return true; - } - - return false; - } -} diff --git a/Magento2/Helpers/PHPCSUtils/Utils/GetTokensAsString.php b/Magento2/Helpers/PHPCSUtils/Utils/GetTokensAsString.php deleted file mode 100644 index c7267f5c..00000000 --- a/Magento2/Helpers/PHPCSUtils/Utils/GetTokensAsString.php +++ /dev/null @@ -1,188 +0,0 @@ -getTokens(); - - if (\is_int($start) === false || isset($tokens[$start]) === false) { - throw new RuntimeException( - 'The $start position for GetTokensAsString methods must exist in the token stack' - ); - } - - if (\is_int($end) === false || $end < $start) { - return ''; - } - - $str = ''; - if ($end >= $phpcsFile->numTokens) { - $end = ($phpcsFile->numTokens - 1); - } - - $lastAdded = null; - for ($i = $start; $i <= $end; $i++) { - if ($stripComments === true && isset(Tokens::$commentTokens[$tokens[$i]['code']])) { - continue; - } - - if ($stripWhitespace === true && $tokens[$i]['code'] === \T_WHITESPACE) { - continue; - } - - if ($compact === true && $tokens[$i]['code'] === \T_WHITESPACE) { - if (isset($lastAdded) === false || $tokens[$lastAdded]['code'] !== \T_WHITESPACE) { - $str .= ' '; - $lastAdded = $i; - } - continue; - } - - // If tabs are being converted to spaces by the tokenizer, the - // original content should be used instead of the converted content. - if ($origContent === true && isset($tokens[$i]['orig_content']) === true) { - $str .= $tokens[$i]['orig_content']; - } else { - $str .= $tokens[$i]['content']; - } - - $lastAdded = $i; - } - - return $str; - } - - /** - * Retrieve the code-tokens only content of the tokens from the specified start position - * in the token stack to the specified end position (inclusive) without whitespace or comments. - * - * This is, for instance, useful to retrieve a namespace name without stray whitespace or comments. - * Use this function selectively and with care! - * - * @see \PHP_CodeSniffer\Files\File::getTokensAsString() Loosely related function. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $start The position to start from in the token stack. - * @param int $end The position to end at in the token stack (inclusive). - * - * @return string The token contents stripped off comments and whitespace. - * - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified start position does not exist. - */ - public static function noEmpties(File $phpcsFile, $start, $end) - { - return self::getString($phpcsFile, $start, $end, false, true, true); - } -} diff --git a/Magento2/Helpers/PHPCSUtils/Utils/ObjectDeclarations.php b/Magento2/Helpers/PHPCSUtils/Utils/ObjectDeclarations.php deleted file mode 100644 index fdb46adb..00000000 --- a/Magento2/Helpers/PHPCSUtils/Utils/ObjectDeclarations.php +++ /dev/null @@ -1,363 +0,0 @@ -getTokens(); - - if (isset($tokens[$stackPtr]) === false - || ($tokens[$stackPtr]['code'] === \T_ANON_CLASS || $tokens[$stackPtr]['code'] === \T_CLOSURE) - ) { - return null; - } - - $tokenCode = $tokens[$stackPtr]['code']; - - /* - * BC: Work-around JS ES6 classes not being tokenized as T_CLASS in PHPCS < 3.0.0. - */ - if (isset($phpcsFile->tokenizerType) - && $phpcsFile->tokenizerType === 'JS' - && $tokenCode === \T_STRING - && $tokens[$stackPtr]['content'] === 'class' - ) { - $tokenCode = \T_CLASS; - } - - if ($tokenCode !== \T_FUNCTION - && $tokenCode !== \T_CLASS - && $tokenCode !== \T_INTERFACE - && $tokenCode !== \T_TRAIT - ) { - throw new RuntimeException( - 'Token type "' . $tokens[$stackPtr]['type'] . '" is not T_FUNCTION, T_CLASS, T_INTERFACE or T_TRAIT' - ); - } - - if ($tokenCode === \T_FUNCTION - && \strtolower($tokens[$stackPtr]['content']) !== 'function' - ) { - // This is a function declared without the "function" keyword. - // So this token is the function name. - return $tokens[$stackPtr]['content']; - } - - /* - * Determine the name. Note that we cannot simply look for the first T_STRING - * because an (invalid) class name starting with a number will be multiple tokens. - * Whitespace or comment are however not allowed within a name. - */ - - $stopPoint = $phpcsFile->numTokens; - if ($tokenCode === \T_FUNCTION && isset($tokens[$stackPtr]['parenthesis_opener']) === true) { - $stopPoint = $tokens[$stackPtr]['parenthesis_opener']; - } elseif (isset($tokens[$stackPtr]['scope_opener']) === true) { - $stopPoint = $tokens[$stackPtr]['scope_opener']; - } - - $exclude = Tokens::$emptyTokens; - $exclude[] = \T_OPEN_PARENTHESIS; - $exclude[] = \T_OPEN_CURLY_BRACKET; - $exclude[] = \T_BITWISE_AND; - - $nameStart = $phpcsFile->findNext($exclude, ($stackPtr + 1), $stopPoint, true); - if ($nameStart === false) { - // Live coding or parse error. - return null; - } - - $tokenAfterNameEnd = $phpcsFile->findNext($exclude, $nameStart, $stopPoint); - - if ($tokenAfterNameEnd === false) { - $content = null; - - /* - * BC: In PHPCS 2.6.0, in case of live coding, the last token in a file will be tokenized - * as T_STRING, but won't have the `content` index set. - */ - if (isset($tokens[$nameStart]['content'])) { - $content = $tokens[$nameStart]['content']; - } - - return $content; - } - - // Name starts with number, so is composed of multiple tokens. - return GetTokensAsString::noEmpties($phpcsFile, $nameStart, ($tokenAfterNameEnd - 1)); - } - - /** - * Retrieves the implementation properties of a class. - * - * Main differences with the PHPCS version: - * - Bugs fixed: - * - Handling of PHPCS annotations. - * - Handling of unorthodox docblock placement. - * - A class cannot both be abstract as well as final, so this utility should not allow for that. - * - Defensive coding against incorrect calls to this method. - * - * @see \PHP_CodeSniffer\Files\File::getClassProperties() Original source. - * @see \PHPCSUtils\BackCompat\BCFile::getClassProperties() Cross-version compatible version of the original. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position in the stack of the `T_CLASS` - * token to acquire the properties for. - * - * @return array Array with implementation properties of a class. - * The format of the return value is: - * ```php - * array( - * 'is_abstract' => false, // TRUE if the abstract keyword was found. - * 'is_final' => false, // TRUE if the final keyword was found. - * ); - * ``` - * - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a - * `T_CLASS` token. - */ - public static function getClassProperties(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]) === false || $tokens[$stackPtr]['code'] !== \T_CLASS) { - throw new RuntimeException('$stackPtr must be of type T_CLASS'); - } - - $valid = Collections::$classModifierKeywords + Tokens::$emptyTokens; - $properties = [ - 'is_abstract' => false, - 'is_final' => false, - ]; - - for ($i = ($stackPtr - 1); $i > 0; $i--) { - if (isset($valid[$tokens[$i]['code']]) === false) { - break; - } - - switch ($tokens[$i]['code']) { - case \T_ABSTRACT: - $properties['is_abstract'] = true; - break 2; - - case \T_FINAL: - $properties['is_final'] = true; - break 2; - } - } - - return $properties; - } - - /** - * Retrieves the name of the class that the specified class extends. - * - * Works for classes, anonymous classes and interfaces, though it is strongly recommended - * to use the {@see \PHPCSUtils\Utils\ObjectDeclarations::findExtendedInterfaceNames()} - * method to examine interfaces instead. Interfaces can extend multiple parent interfaces, - * and that use-case is not handled by this method. - * - * Main differences with the PHPCS version: - * - Bugs fixed: - * - Handling of PHPCS annotations. - * - Handling of comments. - * - Improved handling of parse errors. - * - The returned name will be clean of superfluous whitespace and/or comments. - * - * @see \PHP_CodeSniffer\Files\File::findExtendedClassName() Original source. - * @see \PHPCSUtils\BackCompat\BCFile::findExtendedClassName() Cross-version compatible version of - * the original. - * @see \PHPCSUtils\Utils\ObjectDeclarations::findExtendedInterfaceNames() Similar method for extended interfaces. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The stack position of the class or interface. - * - * @return string|false The extended class name or `FALSE` on error or if there - * is no extended class name. - */ - public static function findExtendedClassName(File $phpcsFile, $stackPtr) - { - $names = self::findNames($phpcsFile, $stackPtr, \T_EXTENDS, Collections::$OOCanExtend); - if ($names === false) { - return false; - } - - // Classes can only extend one parent class. - return \array_shift($names); - } - - /** - * Retrieves the names of the interfaces that the specified class implements. - * - * Main differences with the PHPCS version: - * - Bugs fixed: - * - Handling of PHPCS annotations. - * - Handling of comments. - * - Improved handling of parse errors. - * - The returned name(s) will be clean of superfluous whitespace and/or comments. - * - * @see \PHP_CodeSniffer\Files\File::findImplementedInterfaceNames() Original source. - * @see \PHPCSUtils\BackCompat\BCFile::findImplementedInterfaceNames() Cross-version compatible version of - * the original. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The stack position of the class. - * - * @return array|false Array with names of the implemented interfaces or `FALSE` on - * error or if there are no implemented interface names. - */ - public static function findImplementedInterfaceNames(File $phpcsFile, $stackPtr) - { - return self::findNames($phpcsFile, $stackPtr, \T_IMPLEMENTS, Collections::$OOCanImplement); - } - - /** - * Retrieves the names of the interfaces that the specified interface extends. - * - * @see \PHPCSUtils\Utils\ObjectDeclarations::findExtendedClassName() Similar method for extended classes. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The stack position of the interface keyword. - * - * @return array|false Array with names of the extended interfaces or `FALSE` on - * error or if there are no extended interface names. - */ - public static function findExtendedInterfaceNames(File $phpcsFile, $stackPtr) - { - return self::findNames( - $phpcsFile, - $stackPtr, - \T_EXTENDS, - [\T_INTERFACE => \T_INTERFACE] - ); - } - - /** - * Retrieves the names of the extended classes or interfaces or the implemented - * interfaces that the specific class/interface declaration extends/implements. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The stack position of the - * class/interface declaration keyword. - * @param int $keyword The token constant for the keyword to examine. - * Either `T_EXTENDS` or `T_IMPLEMENTS`. - * @param array $allowedFor Array of OO types for which use of the keyword - * is allowed. - * - * @return array|false Returns an array of names or `FALSE` on error or when the object - * being declared does not extend/implement another object. - */ - private static function findNames(File $phpcsFile, $stackPtr, $keyword, $allowedFor) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]) === false - || isset($allowedFor[$tokens[$stackPtr]['code']]) === false - || isset($tokens[$stackPtr]['scope_opener']) === false - ) { - return false; - } - - $scopeOpener = $tokens[$stackPtr]['scope_opener']; - $keywordPtr = $phpcsFile->findNext($keyword, ($stackPtr + 1), $scopeOpener); - if ($keywordPtr === false) { - return false; - } - - $find = [ - \T_NS_SEPARATOR, - \T_STRING, - ]; - $find += Tokens::$emptyTokens; - - $names = []; - $end = $keywordPtr; - do { - $start = ($end + 1); - $end = $phpcsFile->findNext($find, $start, ($scopeOpener + 1), true); - $name = GetTokensAsString::noEmpties($phpcsFile, $start, ($end - 1)); - - if (\trim($name) !== '') { - $names[] = $name; - } - } while ($tokens[$end]['code'] === \T_COMMA); - - if (empty($names)) { - return false; - } - - return $names; - } -} diff --git a/Magento2/Helpers/PHPCSUtils/Utils/Parentheses.php b/Magento2/Helpers/PHPCSUtils/Utils/Parentheses.php deleted file mode 100644 index 26ba1fd2..00000000 --- a/Magento2/Helpers/PHPCSUtils/Utils/Parentheses.php +++ /dev/null @@ -1,155 +0,0 @@ - => - */ - private static $extraParenthesesOwners = [ - \T_LIST => \T_LIST, - \T_ISSET => \T_ISSET, - \T_UNSET => \T_UNSET, - \T_EMPTY => \T_EMPTY, - \T_EXIT => \T_EXIT, - \T_EVAL => \T_EVAL, - \T_ANON_CLASS => \T_ANON_CLASS, - // Work-around: anon classes were, in certain circumstances, tokenized as T_CLASS prior to PHPCS 3.4.0. - \T_CLASS => \T_CLASS, - ]; - - /** - * Get the stack pointer to the parentheses owner of an open/close parenthesis. - * - * @since 1.0.0 - * @since 1.0.0-alpha2 Added BC support for PHP 7.4 arrow functions. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position of `T_OPEN/CLOSE_PARENTHESIS` token. - * - * @return int|false Integer stack pointer to the parentheses owner; or `FALSE` if the - * parenthesis does not have a (direct) owner or if the token passed - * was not a parenthesis. - */ - public static function getOwner(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]['parenthesis_owner'])) { - return $tokens[$stackPtr]['parenthesis_owner']; - } - - /* - * - `T_FN` was only backfilled in PHPCS 3.5.3/4/5. - * - On PHP 7.4 with PHPCS < 3.5.3, T_FN will not yet be a parentheses owner. - * - On PHP < 7.4 with PHPCS < 3.5.3, T_FN will be tokenized as T_STRING and not yet be a parentheses owner. - * - * {@internal As the 'parenthesis_owner' index is only set on parentheses, we didn't need to do any - * input validation before, but now we do.} - */ - if (isset($tokens[$stackPtr]) === false - || ($tokens[$stackPtr]['code'] !== \T_OPEN_PARENTHESIS - && $tokens[$stackPtr]['code'] !== \T_CLOSE_PARENTHESIS) - ) { - return false; - } - - if ($tokens[$stackPtr]['code'] === \T_CLOSE_PARENTHESIS) { - $stackPtr = $tokens[$stackPtr]['parenthesis_opener']; - } - - $skip = Tokens::$emptyTokens; - $skip[\T_BITWISE_AND] = \T_BITWISE_AND; - - $prevNonEmpty = $phpcsFile->findPrevious($skip, ($stackPtr - 1), null, true); - if ($prevNonEmpty !== false - && (isset(self::$extraParenthesesOwners[$tokens[$prevNonEmpty]['code']]) - // Possibly an arrow function. - || FunctionDeclarations::isArrowFunction($phpcsFile, $prevNonEmpty) === true) - ) { - return $prevNonEmpty; - } - - return false; - } - - /** - * Check whether the parenthesis owner of an open/close parenthesis is within a limited - * set of valid owners. - * - * @since 1.0.0 - * @since 1.0.0-alpha2 Added BC support for PHP 7.4 arrow functions. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position of `T_OPEN/CLOSE_PARENTHESIS` token. - * @param int|string|array $validOwners Array of token constants for the owners - * which should be considered valid. - * - * @return bool `TRUE` if the owner is within the list of `$validOwners`; `FALSE` if not and - * if the parenthesis does not have a (direct) owner. - */ - public static function isOwnerIn(File $phpcsFile, $stackPtr, $validOwners) - { - $owner = self::getOwner($phpcsFile, $stackPtr); - if ($owner === false) { - return false; - } - - $tokens = $phpcsFile->getTokens(); - $validOwners = (array) $validOwners; - - /* - * Work around tokenizer bug where anon classes were, in certain circumstances, tokenized - * as `T_CLASS` prior to PHPCS 3.4.0. - * As `T_CLASS` is normally not an parenthesis owner, we can safely add it to the array - * without doing a version check. - */ - if (\in_array(\T_ANON_CLASS, $validOwners, true)) { - $validOwners[] = \T_CLASS; - } - - /* - * Allow for T_FN token being tokenized as T_STRING before PHPCS 3.5.3. - */ - if (\defined('T_FN') && \in_array(\T_FN, $validOwners, true)) { - $validOwners += Collections::arrowFunctionTokensBC(); - } - - return \in_array($tokens[$owner]['code'], $validOwners, true); - } -} diff --git a/Magento2/Helpers/PHPCSUtils/Utils/Scopes.php b/Magento2/Helpers/PHPCSUtils/Utils/Scopes.php deleted file mode 100644 index 3975a6b3..00000000 --- a/Magento2/Helpers/PHPCSUtils/Utils/Scopes.php +++ /dev/null @@ -1,80 +0,0 @@ -getTokens(); - $validScopes = (array) $validScopes; - - if (\in_array($tokens[$ptr]['code'], $validScopes, true) === true) { - return $ptr; - } - } - - return false; - } - - /** - * Check whether a T_FUNCTION token is a class/interface/trait method declaration. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack of the - * `T_FUNCTION` token to verify. - * - * @return bool - */ - public static function isOOMethod(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]) === false || $tokens[$stackPtr]['code'] !== \T_FUNCTION) { - return false; - } - - if (self::validDirectScope($phpcsFile, $stackPtr, BCTokens::ooScopeTokens()) !== false) { - return true; - } - - return false; - } -} diff --git a/Magento2/Helpers/PHPCSUtils/Utils/TextStrings.php b/Magento2/Helpers/PHPCSUtils/Utils/TextStrings.php deleted file mode 100644 index aca9ce09..00000000 --- a/Magento2/Helpers/PHPCSUtils/Utils/TextStrings.php +++ /dev/null @@ -1,133 +0,0 @@ -getTokens(); - - // Must be the start of a text string token. - if (isset($tokens[$stackPtr], Collections::$textStingStartTokens[$tokens[$stackPtr]['code']]) === false) { - throw new RuntimeException( - '$stackPtr must be of type T_START_HEREDOC, T_START_NOWDOC, T_CONSTANT_ENCAPSED_STRING' - . ' or T_DOUBLE_QUOTED_STRING' - ); - } - - if ($tokens[$stackPtr]['code'] === \T_CONSTANT_ENCAPSED_STRING - || $tokens[$stackPtr]['code'] === \T_DOUBLE_QUOTED_STRING - ) { - $prev = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$stackPtr]['code'] === $tokens[$prev]['code']) { - throw new RuntimeException('$stackPtr must be the start of the text string'); - } - } - - $stripNewline = false; - - switch ($tokens[$stackPtr]['code']) { - case \T_START_HEREDOC: - $stripQuotes = false; - $stripNewline = true; - $targetType = \T_HEREDOC; - $current = ($stackPtr + 1); - break; - - case \T_START_NOWDOC: - $stripQuotes = false; - $stripNewline = true; - $targetType = \T_NOWDOC; - $current = ($stackPtr + 1); - break; - - default: - $targetType = $tokens[$stackPtr]['code']; - $current = $stackPtr; - break; - } - - $string = ''; - do { - $string .= $tokens[$current]['content']; - ++$current; - } while (isset($tokens[$current]) && $tokens[$current]['code'] === $targetType); - - if ($stripNewline === true) { - // Heredoc/nowdoc: strip the new line at the end of the string to emulate how PHP sees the string. - $string = \rtrim($string, "\r\n"); - } - - if ($stripQuotes === true) { - return self::stripQuotes($string); - } - - return $string; - } - - /** - * Strip text delimiter quotes from an arbitrary string. - * - * Intended for use with the "contents" of a `T_CONSTANT_ENCAPSED_STRING` / `T_DOUBLE_QUOTED_STRING`. - * - * - Prevents stripping mis-matched quotes. - * - Prevents stripping quotes from the textual content of the string. - * - * @since 1.0.0 - * - * @param string $string The raw string. - * - * @return string String without quotes around it. - */ - public static function stripQuotes($string) - { - return \preg_replace('`^([\'"])(.*)\1$`Ds', '$2', $string); - } -} diff --git a/Magento2/Helpers/PHPCSUtils/Utils/UseStatements.php b/Magento2/Helpers/PHPCSUtils/Utils/UseStatements.php deleted file mode 100644 index 5e965d33..00000000 --- a/Magento2/Helpers/PHPCSUtils/Utils/UseStatements.php +++ /dev/null @@ -1,412 +0,0 @@ -getTokens(); - - if (isset($tokens[$stackPtr]) === false - || $tokens[$stackPtr]['code'] !== \T_USE - ) { - throw new RuntimeException('$stackPtr must be of type T_USE'); - } - - $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($next === false) { - // Live coding or parse error. - return ''; - } - - $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($prev !== false && $tokens[$prev]['code'] === \T_CLOSE_PARENTHESIS - && Parentheses::isOwnerIn($phpcsFile, $prev, \T_CLOSURE) === true - ) { - return 'closure'; - } - - $lastCondition = Conditions::getLastCondition($phpcsFile, $stackPtr); - if ($lastCondition === false || $tokens[$lastCondition]['code'] === \T_NAMESPACE) { - // Global or scoped namespace and not a closure use statement. - return 'import'; - } - - $traitScopes = BCTokens::ooScopeTokens(); - // Only classes and traits can import traits. - unset($traitScopes[\T_INTERFACE]); - - if (isset($traitScopes[$tokens[$lastCondition]['code']]) === true) { - return 'trait'; - } - - return ''; - } - - /** - * Determine whether a T_USE token represents a closure use statement. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the `T_USE` token. - * - * @return bool `TRUE` if the token passed is a closure use statement. - * `FALSE` if it's not. - * - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a - * `T_USE` token. - */ - public static function isClosureUse(File $phpcsFile, $stackPtr) - { - return (self::getType($phpcsFile, $stackPtr) === 'closure'); - } - - /** - * Determine whether a T_USE token represents a class/function/constant import use statement. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the `T_USE` token. - * - * @return bool `TRUE` if the token passed is an import use statement. - * `FALSE` if it's not. - * - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a - * `T_USE` token. - */ - public static function isImportUse(File $phpcsFile, $stackPtr) - { - return (self::getType($phpcsFile, $stackPtr) === 'import'); - } - - /** - * Determine whether a T_USE token represents a trait use statement. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the `T_USE` token. - * - * @return bool `TRUE` if the token passed is a trait use statement. - * `FALSE` if it's not. - * - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a - * `T_USE` token. - */ - public static function isTraitUse(File $phpcsFile, $stackPtr) - { - return (self::getType($phpcsFile, $stackPtr) === 'trait'); - } - - /** - * Split an import use statement into individual imports. - * - * Handles single import, multi-import and group-import use statements. - * - * @since 1.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack of the `T_USE` token. - * - * @return array A multi-level array containing information about the use statement. - * The first level is `'name'`, `'function'` and `'const'`. These keys will always exist. - * If any statements are found for any of these categories, the second level - * will contain the alias/name as the key and the full original use name as the - * value for each of the found imports or an empty array if no imports were found - * in this use statement for a particular category. - * - * For example, for this function group use statement: - * ```php - * use function Vendor\Package\{ - * LevelA\Name as Alias, - * LevelB\Another_Name, - * }; - * ``` - * the return value would look like this: - * ```php - * array( - * 'name' => array(), - * 'function' => array( - * 'Alias' => 'Vendor\Package\LevelA\Name', - * 'Another_Name' => 'Vendor\Package\LevelB\Another_Name', - * ), - * 'const' => array(), - * ) - * ``` - * - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a - * `T_USE` token. - * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the `T_USE` token is not for an import - * use statement. - */ - public static function splitImportUseStatement(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if (isset($tokens[$stackPtr]) === false || $tokens[$stackPtr]['code'] !== \T_USE) { - throw new RuntimeException('$stackPtr must be of type T_USE'); - } - - if (self::isImportUse($phpcsFile, $stackPtr) === false) { - throw new RuntimeException('$stackPtr must be an import use statement'); - } - - $statements = [ - 'name' => [], - 'function' => [], - 'const' => [], - ]; - - $endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1)); - if ($endOfStatement === false) { - // Live coding or parse error. - return $statements; - } - - $endOfStatement++; - - $start = true; - $useGroup = false; - $hasAlias = false; - $baseName = ''; - $name = ''; - $type = ''; - $fixedType = false; - $alias = ''; - - for ($i = ($stackPtr + 1); $i < $endOfStatement; $i++) { - if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { - continue; - } - - $tokenCode = $tokens[$i]['code']; - - /* - * BC: Work round a tokenizer bug related to a parse error. - * - * If `function` or `const` is used as the alias, the semi-colon after it would - * be tokenized as T_STRING. - * For `function` this was fixed in PHPCS 2.8.0. For `const` the issue still exists - * in PHPCS 3.5.2. - * - * Along the same lines, the `}` T_CLOSE_USE_GROUP would also be tokenized as T_STRING. - */ - if ($tokenCode === \T_STRING) { - if ($tokens[$i]['content'] === ';') { - $tokenCode = \T_SEMICOLON; - } elseif ($tokens[$i]['content'] === '}') { - $tokenCode = \T_CLOSE_USE_GROUP; - } - } - - switch ($tokenCode) { - case \T_STRING: - // Only when either at the start of the statement or at the start of a new sub within a group. - if ($start === true && $fixedType === false) { - $content = \strtolower($tokens[$i]['content']); - if ($content === 'function' - || $content === 'const' - ) { - $type = $content; - $start = false; - if ($useGroup === false) { - $fixedType = true; - } - - break; - } else { - $type = 'name'; - } - } - - $start = false; - - if ($hasAlias === false) { - $name .= $tokens[$i]['content']; - } - - $alias = $tokens[$i]['content']; - break; - - case \T_AS: - $hasAlias = true; - break; - - case \T_OPEN_USE_GROUP: - $start = true; - $useGroup = true; - $baseName = $name; - $name = ''; - break; - - case \T_SEMICOLON: - case \T_CLOSE_TAG: - case \T_CLOSE_USE_GROUP: - case \T_COMMA: - if ($name !== '') { - if ($useGroup === true) { - $statements[$type][$alias] = $baseName . $name; - } else { - $statements[$type][$alias] = $name; - } - } - - if ($tokenCode !== \T_COMMA) { - break 2; - } - - // Reset. - $start = true; - $name = ''; - $hasAlias = false; - if ($fixedType === false) { - $type = ''; - } - break; - - case \T_NS_SEPARATOR: - $name .= $tokens[$i]['content']; - break; - - case \T_FUNCTION: - case \T_CONST: - /* - * BC: Work around tokenizer bug in PHPCS < 3.4.1. - * - * `function`/`const` in `use function`/`use const` tokenized as T_FUNCTION/T_CONST - * instead of T_STRING when there is a comment between the keywords. - * - * @link https://github.com/squizlabs/PHP_CodeSniffer/issues/2431 - */ - if ($start === true && $fixedType === false) { - $type = \strtolower($tokens[$i]['content']); - $start = false; - if ($useGroup === false) { - $fixedType = true; - } - - break; - } - - $start = false; - - if ($hasAlias === false) { - $name .= $tokens[$i]['content']; - } - - $alias = $tokens[$i]['content']; - break; - - /* - * Fall back in case reserved keyword is (illegally) used in name. - * Parse error, but not our concern. - */ - default: - if ($hasAlias === false) { - $name .= $tokens[$i]['content']; - } - - $alias = $tokens[$i]['content']; - break; - } - } - - return $statements; - } - - /** - * Split an import use statement into individual imports and merge it with an array of previously - * seen import use statements. - * - * Beware: this method should only be used to combine the import use statements found in *one* file. - * Do NOT combine the statements of multiple files as the result will be inaccurate and unreliable. - * - * In most cases when tempted to use this method, the {@see \PHPCSUtils\AbstractSniffs\AbstractFileContextSniff} - * (upcoming) should be used instead. - * - * @see \PHPCSUtils\AbstractSniffs\AbstractFileContextSniff - * @see \PHPCSUtils\Utils\UseStatements::splitImportUseStatement() - * - * @since 1.0.0-alpha3 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. - * @param int $stackPtr The position in the stack of the `T_USE` token. - * @param array $previousUseStatements The import `use` statements collected so far. - * This should be either the output of a - * previous call to this method or the output of - * an earlier call to the - * {@see UseStatements::splitImportUseStatement()} - * method. - * - * @return array A multi-level array containing information about the current `use` statement combined with - * the previously collected `use` statement information. - * See {@see UseStatements::splitImportUseStatement()} for more details about the array format. - */ - public static function splitAndMergeImportUseStatement(File $phpcsFile, $stackPtr, $previousUseStatements) - { - try { - $useStatements = self::splitImportUseStatement($phpcsFile, $stackPtr); - - if (isset($previousUseStatements['name']) === false) { - $previousUseStatements['name'] = $useStatements['name']; - } else { - $previousUseStatements['name'] += $useStatements['name']; - } - if (isset($previousUseStatements['function']) === false) { - $previousUseStatements['function'] = $useStatements['function']; - } else { - $previousUseStatements['function'] += $useStatements['function']; - } - if (isset($previousUseStatements['const']) === false) { - $previousUseStatements['const'] = $useStatements['const']; - } else { - $previousUseStatements['const'] += $useStatements['const']; - } - } catch (RuntimeException $e) { - // Not an import use statement. - } - - return $previousUseStatements; - } -} diff --git a/Magento2/Sniffs/PHPCompatibility/ChangedIntToBoolParamTypeSniff.php b/Magento2/Sniffs/PHPCompatibility/ChangedIntToBoolParamTypeSniff.php index 673a0fe7..f01be4f6 100644 --- a/Magento2/Sniffs/PHPCompatibility/ChangedIntToBoolParamTypeSniff.php +++ b/Magento2/Sniffs/PHPCompatibility/ChangedIntToBoolParamTypeSniff.php @@ -13,7 +13,7 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Util\Tokens; use PHPCompatibility\AbstractFunctionCallParameterSniff; -use Magento2\Helpers\PHPCSUtils\BackCompat\BCTokens; +use PHPCSUtils\BackCompat\BCTokens; /** * Detect calls to functions where the expected type of a parameter has been changed from integer to boolean. diff --git a/Magento2/Sniffs/PHPCompatibility/ForbiddenFinalPrivateMethodsSniff.php b/Magento2/Sniffs/PHPCompatibility/ForbiddenFinalPrivateMethodsSniff.php index 85b2fe11..365942e7 100644 --- a/Magento2/Sniffs/PHPCompatibility/ForbiddenFinalPrivateMethodsSniff.php +++ b/Magento2/Sniffs/PHPCompatibility/ForbiddenFinalPrivateMethodsSniff.php @@ -12,8 +12,8 @@ use PHPCompatibility\Sniff; use PHP_CodeSniffer\Files\File; -use Magento2\Helpers\PHPCSUtils\Utils\FunctionDeclarations; -use Magento2\Helpers\PHPCSUtils\Utils\Scopes; +use PHPCSUtils\Utils\FunctionDeclarations; +use PHPCSUtils\Utils\Scopes; /** * Applying the final modifier on a private method will produce a warning since PHP 8.0 diff --git a/Magento2/Sniffs/PHPCompatibility/RemovedCallingDestructAfterConstructorExitSniff.php b/Magento2/Sniffs/PHPCompatibility/RemovedCallingDestructAfterConstructorExitSniff.php index 8782039d..0c0dc944 100644 --- a/Magento2/Sniffs/PHPCompatibility/RemovedCallingDestructAfterConstructorExitSniff.php +++ b/Magento2/Sniffs/PHPCompatibility/RemovedCallingDestructAfterConstructorExitSniff.php @@ -13,11 +13,12 @@ use PHPCompatibility\Sniff; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Util\Tokens; -use Magento2\Helpers\PHPCSUtils\Tokens\Collections; -use Magento2\Helpers\PHPCSUtils\Utils\FunctionDeclarations; -use Magento2\Helpers\PHPCSUtils\Utils\ObjectDeclarations; -use Magento2\Helpers\PHPCSUtils\Utils\Scopes; -use Magento2\Helpers\PHPCSUtils\Utils\UseStatements; +use PHPCSUtils\Tokens\Collections; +use PHPCSUtils\Utils\FunctionDeclarations; +use PHPCSUtils\Utils\MessageHelper; +use PHPCSUtils\Utils\ObjectDeclarations; +use PHPCSUtils\Utils\Scopes; +use PHPCSUtils\Utils\UseStatements; /** * As of PHP 8.0, when an object constructor exit()s, the destructor will no longer be called. @@ -100,7 +101,7 @@ public function process(File $phpcsFile, $stackPtr) // Skip over nested closed scopes as possible for efficiency. // Ignore arrow functions as they aren't closed scopes. - if (isset(Collections::$closedScopes[$tokens[$current]['code']]) === true + if (isset(Collections::closedScopes()[$tokens[$current]['code']]) === true && isset($tokens[$current]['scope_closer']) === true ) { $current = $tokens[$current]['scope_closer']; @@ -201,7 +202,7 @@ public function process(File $phpcsFile, $stackPtr) } foreach ($exits as $ptr) { - $this->addMessage($phpcsFile, $error, $ptr, $isError, $errorCode, [$tokens[$ptr]['content']]); + MessageHelper::addMessage($phpcsFile, $error, $ptr, $isError, $errorCode, [$tokens[$ptr]['content']]); } } } diff --git a/Magento2/Sniffs/PHPCompatibility/RemovedOptionalBeforeRequiredParamSniff.php b/Magento2/Sniffs/PHPCompatibility/RemovedOptionalBeforeRequiredParamSniff.php index 588ff7d2..5adff7ee 100644 --- a/Magento2/Sniffs/PHPCompatibility/RemovedOptionalBeforeRequiredParamSniff.php +++ b/Magento2/Sniffs/PHPCompatibility/RemovedOptionalBeforeRequiredParamSniff.php @@ -10,12 +10,11 @@ namespace Magento2\Sniffs\PHPCompatibility; -use PHP_CodeSniffer\Exceptions\RuntimeException; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Util\Tokens; use PHPCompatibility\Sniff; -use Magento2\Helpers\PHPCSUtils\Tokens\Collections; -use Magento2\Helpers\PHPCSUtils\Utils\FunctionDeclarations; +use PHPCSUtils\Tokens\Collections; +use PHPCSUtils\Utils\FunctionDeclarations; /** * Declaring a required function parameter after an optional parameter is deprecated since PHP 8.0. @@ -58,7 +57,7 @@ public function register() { $this->allowedInDefault += Tokens::$emptyTokens; - return Collections::functionDeclarationTokensBC(); + return Collections::functionDeclarationTokens(); } /** @@ -78,14 +77,9 @@ public function process(File $phpcsFile, $stackPtr) return; } - try { - // Get all parameters from the function signature. - $parameters = FunctionDeclarations::getParameters($phpcsFile, $stackPtr); - if (empty($parameters)) { - return; - } - } catch (RuntimeException $e) { - // Most likely a T_STRING which wasn't an arrow function. + // Get all parameters from the function signature. + $parameters = FunctionDeclarations::getParameters($phpcsFile, $stackPtr); + if (empty($parameters)) { return; } diff --git a/Magento2/Tests/PHPCompatibility/BaseSniffTest.php b/Magento2/Tests/PHPCompatibility/BaseSniffTest.php index f6554540..6c84e617 100644 --- a/Magento2/Tests/PHPCompatibility/BaseSniffTest.php +++ b/Magento2/Tests/PHPCompatibility/BaseSniffTest.php @@ -12,7 +12,7 @@ use PHPUnit\Framework\TestCase; use PHP_CodeSniffer\Files\File; -use Magento2\Helpers\PHPCSUtils\BackCompat\Helper; +use PHPCSUtils\BackCompat\Helper; /** * Base sniff test class file. diff --git a/Magento2/Tests/PHPCompatibility/Util/CoreMethodTestFrame.php b/Magento2/Tests/PHPCompatibility/Util/CoreMethodTestFrame.php deleted file mode 100644 index e4441380..00000000 --- a/Magento2/Tests/PHPCompatibility/Util/CoreMethodTestFrame.php +++ /dev/null @@ -1,51 +0,0 @@ -=5.4", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + }, + "require-dev": { + "composer/composer": "*", + "ext-json": "*", + "ext-zip": "*", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0", + "yoast/phpunit-polyfills": "^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "source": "https://github.com/PHPCSStandards/composer-installer" + }, + "time": "2023-01-05T11:28:13+00:00" + }, { "name": "phpcompatibility/php-compatibility", "version": "9.3.5", @@ -68,6 +146,80 @@ }, "time": "2019-12-27T09:44:58+00:00" }, + { + "name": "phpcsstandards/phpcsutils", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", + "reference": "0cfef5193e68e8ff179333d8ae937db62939b656" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/0cfef5193e68e8ff179333d8ae937db62939b656", + "reference": "0cfef5193e68e8ff179333d8ae937db62939b656", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.7.1 || 4.0.x-dev@dev" + }, + "require-dev": { + "ext-filter": "*", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcsstandards/phpcsdevcs": "^1.1.3", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.3", + "yoast/phpunit-polyfills": "^1.0.1" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHPCSUtils/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" + } + ], + "description": "A suite of utility functions for use with PHP_CodeSniffer", + "homepage": "https://phpcsutils.com/", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "phpcs3", + "standards", + "static analysis", + "tokens", + "utility" + ], + "support": { + "docs": "https://phpcsutils.com/", + "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", + "source": "https://github.com/PHPCSStandards/PHPCSUtils" + }, + "time": "2023-04-17T16:27:27+00:00" + }, { "name": "phpstan/phpstan", "version": "1.9.14", From 32d4ded256d0c03071c11603a9e0ef1b4157b5da Mon Sep 17 00:00:00 2001 From: soumah Date: Tue, 18 Apr 2023 17:17:21 -0500 Subject: [PATCH 12/42] ACP2E-1868: Move sniff PHPCompatibility.TextStrings.RemovedDollarBraceStringEmbeds from PHPCompatibility to Magento Coding Standards - Added dependency on phpcsstandards/phpcsutils - Removed internal copy of utils from phpcsstandards/phpcsutils --- .../RemovedDollarBraceStringEmbedsSniff.php | 134 +++++++++ ...movedDollarBraceStringEmbedsUnitTest.1.inc | 90 +++++++ ...movedDollarBraceStringEmbedsUnitTest.2.inc | 42 +++ ...RemovedDollarBraceStringEmbedsUnitTest.php | 254 ++++++++++++++++++ Magento2/ruleset.xml | 1 + 5 files changed, 521 insertions(+) create mode 100644 Magento2/Sniffs/PHPCompatibility/RemovedDollarBraceStringEmbedsSniff.php create mode 100644 Magento2/Tests/PHPCompatibility/RemovedDollarBraceStringEmbedsUnitTest.1.inc create mode 100644 Magento2/Tests/PHPCompatibility/RemovedDollarBraceStringEmbedsUnitTest.2.inc create mode 100644 Magento2/Tests/PHPCompatibility/RemovedDollarBraceStringEmbedsUnitTest.php diff --git a/Magento2/Sniffs/PHPCompatibility/RemovedDollarBraceStringEmbedsSniff.php b/Magento2/Sniffs/PHPCompatibility/RemovedDollarBraceStringEmbedsSniff.php new file mode 100644 index 00000000..200cffbd --- /dev/null +++ b/Magento2/Sniffs/PHPCompatibility/RemovedDollarBraceStringEmbedsSniff.php @@ -0,0 +1,134 @@ + PHP allows embedding variables in strings with double-quotes (") and heredoc in various ways. + * > 1. Directly embedding variables (`$foo`) + * > 2. Braces outside the variable (`{$foo}`) + * > 3. Braces after the dollar sign (`${foo}`) + * > 4. Variable variables (`${expr}`, equivalent to `(string) ${expr}`) + * > + * > [...] to deprecate options 3 and 4 in PHP 8.2 and remove them in PHP 9.0. + * + * PHP version 8.2 + * PHP version 9.0 + * + * @link https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation + * + * @since 10.0.0 + */ +class RemovedDollarBraceStringEmbedsSniff extends Sniff +{ + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 10.0.0 + * + * @return array + */ + public function register() + { + return [ + \T_DOUBLE_QUOTED_STRING, + \T_START_HEREDOC, + \T_DOLLAR_OPEN_CURLY_BRACES, + ]; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 10.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * + * @return void|int Void or a stack pointer to skip forward. + */ + public function process(File $phpcsFile, $stackPtr) + { + if ($this->supportsAbove('8.2') === false) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + /* + * Defensive coding, this code is not expected to ever actually be hit since PHPCS#3604 + * (included in 3.7.0), but _will_ be hit if a file containing a PHP 7.3 indented heredoc/nowdocs + * is scanned with PHPCS on PHP < 7.3. People shouldn't do that, but hey, we can't stop them. + */ + if ($tokens[$stackPtr]['code'] === \T_DOLLAR_OPEN_CURLY_BRACES) { + // @codeCoverageIgnoreStart + if ($tokens[($stackPtr - 1)]['code'] === \T_DOUBLE_QUOTED_STRING) { + --$stackPtr; + } else { + // Throw an error anyway, though it won't be very informative. + $message = 'Using ${} in strings is deprecated since PHP 8.2, use {$var} or {${expr}} instead.'; + $code = 'DeprecatedDollarBraceEmbed'; + $phpcsFile->addWarning($message, $stackPtr, $code); + return; + } + // @codeCoverageIgnoreEnd + } + + $endOfString = TextStrings::getEndOfCompleteTextString($phpcsFile, $stackPtr); + $startOfString = $stackPtr; + if ($tokens[$stackPtr]['code'] === \T_START_HEREDOC) { + $startOfString = ($stackPtr + 1); + } + + $contents = GetTokensAsString::normal($phpcsFile, $startOfString, $endOfString); + if (\strpos($contents, '${') === false) { + // No interpolation found or only interpolations which are still supported. + return ($endOfString + 1); + } + + $embeds = TextStrings::getEmbeds($contents); + foreach ($embeds as $offset => $embed) { + if (\strpos($embed, '${') !== 0) { + continue; + } + + // Figure out the stack pointer to throw the warning on. + $errorPtr = $startOfString; + $length = 0; + while (($length + $tokens[$errorPtr]['length']) < $offset) { + $length += $tokens[$errorPtr]['length']; + ++$errorPtr; + } + + // Type 4. + $message = 'Using %s (variable variables) in strings is deprecated since PHP 8.2, use {${expr}} instead.'; + $code = 'DeprecatedExpressionSyntax'; + if (\preg_match('`^\$\{(?P[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]+)(?:\[([\'"])?[^\$\{\}\]]+(?:\2)?\])?\}$`', $embed) === 1) { + // Type 3. + $message = 'Using ${var} in strings is deprecated since PHP 8.2, use {$var} instead. Found: %s'; + $code = 'DeprecatedVariableSyntax'; + } + + $phpcsFile->addWarning($message, $errorPtr, $code, [$embed]); + + } + + return ($endOfString + 1); + } +} diff --git a/Magento2/Tests/PHPCompatibility/RemovedDollarBraceStringEmbedsUnitTest.1.inc b/Magento2/Tests/PHPCompatibility/RemovedDollarBraceStringEmbedsUnitTest.1.inc new file mode 100644 index 00000000..4ec71d18 --- /dev/null +++ b/Magento2/Tests/PHPCompatibility/RemovedDollarBraceStringEmbedsUnitTest.1.inc @@ -0,0 +1,90 @@ +bar"; +$text = "some text $var some text"; + +$heredoc = <<bar}"; +echo "{$foo->bar()}"; +echo "{$foo['bar']->baz()()}"; +echo "{${$bar}}"; +echo "{$foo()}"; +echo "{${$object->getMethod()}}" +$text = "some text {$var} some text"; + +$heredoc = <<<"EOD" +some text {$var} some text +EOD; + +/* + * Not our target. + */ + +// Ordinary variable variables outside strings. +$foo = ${'bar'}; + +// Heredoc without embeds. +echo <<bar}"; +echo "${$object->getMethod()}" +$text = "some text ${(foo)} some text"; +echo "${substr('laruence', 0, 2)}"; + +echo "${foo["${bar}"]}"; +echo "${foo["${bar['baz']}"]}"; +echo "${foo->{$baz}}"; +echo "${foo->{${'a'}}}"; +echo "${foo->{"${'a'}"}}"; + +// Verify correct handling of stack pointers in multi-token code. +$text = "Line without embed +some text ${foo["${bar}"]} some text +some text ${foo["${bar['baz']}"]} some text +some text ${foo->{${'a'}}} some text +"; + +$heredoc = <<<"EOD" +some text ${(foo)} some text +EOD; diff --git a/Magento2/Tests/PHPCompatibility/RemovedDollarBraceStringEmbedsUnitTest.2.inc b/Magento2/Tests/PHPCompatibility/RemovedDollarBraceStringEmbedsUnitTest.2.inc new file mode 100644 index 00000000..f637fbf1 --- /dev/null +++ b/Magento2/Tests/PHPCompatibility/RemovedDollarBraceStringEmbedsUnitTest.2.inc @@ -0,0 +1,42 @@ +getMethod()} some text + some text ${foo["${bar['baz']}"]} some text + some text ${foo->{${'a'}}} some text + EOD; diff --git a/Magento2/Tests/PHPCompatibility/RemovedDollarBraceStringEmbedsUnitTest.php b/Magento2/Tests/PHPCompatibility/RemovedDollarBraceStringEmbedsUnitTest.php new file mode 100644 index 00000000..8009b2cb --- /dev/null +++ b/Magento2/Tests/PHPCompatibility/RemovedDollarBraceStringEmbedsUnitTest.php @@ -0,0 +1,254 @@ +sniffFile(__DIR__ . '/' . self::TEST_FILE, '8.2'); + $this->assertWarning($file, $line, 'Using ${var} in strings is deprecated since PHP 8.2, use {$var} instead. Found: ' . $found); + } + + /** + * Data provider. + * + * @see testRemovedDollarBraceStringEmbedsType3() + * + * @return array + */ + public function dataRemovedDollarBraceStringEmbedsType3() + { + return [ + [57, '${foo}'], + [58, '${foo[\'bar\']}'], + [59, '${foo}'], + [59, '${text}'], + [62, '${foo}'], + [65, '${foo}'], + ]; + } + + + /** + * Test that variable embeds of "type 4" - Variable variables (�${expr}�, equivalent to + * (string) ${expr}) - are correctly detected. + * + * @dataProvider dataRemovedDollarBraceStringEmbedsType4 + * + * @param int $line The line number. + * @param string $found The embedded expression found. + * + * @return void + */ + public function testRemovedDollarBraceStringEmbedsType4($line, $found) + { + $file = $this->sniffFile(__DIR__ . '/' . self::TEST_FILE, '8.2'); + $this->assertWarning($file, $line, "Using {$found} (variable variables) in strings is deprecated since PHP 8.2, use {\${expr}} instead."); + } + + /** + * Data provider. + * + * @see testRemovedDollarBraceStringEmbedsType4() + * + * @return array + */ + public function dataRemovedDollarBraceStringEmbedsType4() + { + return [ + [68, '${$bar}'], + [69, '${(foo)}'], + [70, '${foo->bar}'], + [71, '${$object->getMethod()}'], + [72, '${(foo)}'], + [73, '${substr(\'laruence\', 0, 2)}'], + [75, '${foo["${bar}"]}'], + [76, '${foo["${bar[\'baz\']}"]}'], + [77, '${foo->{$baz}}'], + [78, '${foo->{${\'a\'}}}'], + [79, '${foo->{"${\'a\'}"}}'], + [83, '${foo["${bar}"]}'], + [84, '${foo["${bar[\'baz\']}"]}'], + [85, '${foo->{${\'a\'}}}'], + [89, '${(foo)}'], + ]; + } + + + /** + * Test that variable embeds of "type 3" - Braces after the dollar sign (�${foo}�) - + * are correctly detected in PHP 7.3+ indented heredocs. + * + * @dataProvider dataRemovedDollarBraceStringEmbedsType3InIndentedHeredoc + * + * @param int $line The line number. + * @param string $found The embedded variable found. + * + * @return void + */ + public function testRemovedDollarBraceStringEmbedsType3InIndentedHeredoc($line, $found) + { + if (\PHP_VERSION_ID < 70300) { + $this->markTestSkipped('Test code involving PHP 7.3 heredocs will not tokenize correctly on PHP < 7.3'); + } + + $file = $this->sniffFile(__DIR__ . '/' . self::TEST_FILE_PHP73HEREDOCS, '8.2'); + $this->assertWarning($file, $line, 'Using ${var} in strings is deprecated since PHP 8.2, use {$var} instead. Found: ' . $found); + } + + /** + * Data provider. + * + * @see testRemovedDollarBraceStringEmbedsType3InIndentedHeredoc() + * + * @return array + */ + public function dataRemovedDollarBraceStringEmbedsType3InIndentedHeredoc() + { + return [ + [33, '${foo[\'bar\']}'], + ]; + } + + + /** + * Test that variable embeds of "type 4" - Variable variables (�${expr}�, equivalent to + * (string) ${expr}) - are correctly detected in PHP 7.3+ indented heredocs. + * + * @dataProvider dataRemovedDollarBraceStringEmbedsType4InIndentedHeredoc + * + * @param int $line The line number. + * @param string $found The embedded expression found. + * + * @return void + */ + public function testRemovedDollarBraceStringEmbedsType4InIndentedHeredoc($line, $found) + { + if (\PHP_VERSION_ID < 70300) { + $this->markTestSkipped('Test code involving PHP 7.3 heredocs will not tokenize correctly on PHP < 7.3'); + } + + $file = $this->sniffFile(__DIR__ . '/' . self::TEST_FILE_PHP73HEREDOCS, '8.2'); + $this->assertWarning($file, $line, "Using {$found} (variable variables) in strings is deprecated since PHP 8.2, use {\${expr}} instead."); + } + + /** + * Data provider. + * + * @see testRemovedDollarBraceStringEmbedsType4InIndentedHeredoc() + * + * @return array + */ + public function dataRemovedDollarBraceStringEmbedsType4InIndentedHeredoc() + { + return [ + [39, '${$object->getMethod()}'], + [40, '${foo["${bar[\'baz\']}"]}'], + [41, '${foo->{${\'a\'}}}'], + ]; + } + + + /** + * Verify the sniff does not throw false positives for valid code. + * + * @dataProvider dataTestFiles + * + * @param string $testFile File name for the test case file to use. + * @param int $lines Number of lines at the top of the file for which we don't expect errors. + * + * @return void + */ + public function testNoFalsePositives($testFile, $lines) + { + if ($testFile === self::TEST_FILE_PHP73HEREDOCS && \PHP_VERSION_ID < 70300) { + $this->markTestSkipped('Test code involving PHP 7.3 heredocs will not tokenize correctly on PHP < 7.3'); + } + + $file = $this->sniffFile(__DIR__ . '/' . $testFile, '8.2'); + + // No errors expected on the first # lines. + for ($line = 1; $line <= $lines; $line++) { + $this->assertNoViolation($file, $line); + } + } + + + /** + * Verify no notices are thrown at all. + * + * @dataProvider dataTestFiles + * + * @param string $testFile File name for the test case file to use. + * + * @return void + */ + public function testNoViolationsInFileOnValidVersion($testFile) + { + if ($testFile === self::TEST_FILE_PHP73HEREDOCS && \PHP_VERSION_ID < 70300) { + $this->markTestSkipped('Test code involving PHP 7.3 heredocs will not tokenize correctly on PHP < 7.3'); + } + + $file = $this->sniffFile(__DIR__ . '/' . $testFile, '8.1'); + $this->assertNoViolation($file); + } + + + /** + * Data provider. + * + * @return array + */ + public function dataTestFiles() + { + return [ + [self::TEST_FILE, 51], + [self::TEST_FILE_PHP73HEREDOCS, 26], + ]; + } +} diff --git a/Magento2/ruleset.xml b/Magento2/ruleset.xml index ee171871..b26c8a73 100644 --- a/Magento2/ruleset.xml +++ b/Magento2/ruleset.xml @@ -783,4 +783,5 @@ + From 274949b0dd47a0e0d2e5cb2f71493028aaa2d25d Mon Sep 17 00:00:00 2001 From: soumah Date: Thu, 27 Apr 2023 13:56:55 -0500 Subject: [PATCH 13/42] ACP2E-1871: Extend PHPCompatibility.FunctionUse.RemovedFunctions to add deprecated/removed functions in PHP8.x --- .../RemovedFunctionsSniff.php | 5135 +++++++++++++++++ .../RemovedFunctionsUnitTest.inc | 1236 ++++ .../RemovedFunctionsUnitTest.php | 1552 +++++ Magento2/ruleset.xml | 4 +- 4 files changed, 7926 insertions(+), 1 deletion(-) create mode 100644 Magento2/Sniffs/PHPCompatibility/RemovedFunctionsSniff.php create mode 100644 Magento2/Tests/PHPCompatibility/RemovedFunctionsUnitTest.inc create mode 100644 Magento2/Tests/PHPCompatibility/RemovedFunctionsUnitTest.php diff --git a/Magento2/Sniffs/PHPCompatibility/RemovedFunctionsSniff.php b/Magento2/Sniffs/PHPCompatibility/RemovedFunctionsSniff.php new file mode 100644 index 00000000..d9b3ff6b --- /dev/null +++ b/Magento2/Sniffs/PHPCompatibility/RemovedFunctionsSniff.php @@ -0,0 +1,5135 @@ + array(string => bool|string|null)) + */ + protected $removedFunctions = [ + 'crack_check' => [ + '5.0' => true, + 'extension' => 'crack', + ], + 'crack_closedict' => [ + '5.0' => true, + 'extension' => 'crack', + ], + 'crack_getlastmessage' => [ + '5.0' => true, + 'extension' => 'crack', + ], + 'crack_opendict' => [ + '5.0' => true, + 'extension' => 'crack', + ], + + 'php_check_syntax' => [ + '5.0.5' => true, + ], + + 'pfpro_cleanup' => [ + '5.1' => true, + 'extension' => 'pfpro', + ], + 'pfpro_init' => [ + '5.1' => true, + 'extension' => 'pfpro', + ], + 'pfpro_process_raw' => [ + '5.1' => true, + 'extension' => 'pfpro', + ], + 'pfpro_process' => [ + '5.1' => true, + 'extension' => 'pfpro', + ], + 'pfpro_version' => [ + '5.1' => true, + 'extension' => 'pfpro', + ], + 'm_checkstatus' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_completeauthorizations' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_connect' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_connectionerror' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_deletetrans' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_destroyconn' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_destroyengine' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_getcell' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_getcellbynum' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_getcommadelimited' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_getheader' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_initconn' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_initengine' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_iscommadelimited' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_maxconntimeout' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_monitor' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_numcolumns' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_numrows' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_parsecommadelimited' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_responsekeys' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_responseparam' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_returnstatus' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_setblocking' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_setdropfile' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_setip' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_setssl_cafile' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_setssl_files' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_setssl' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_settimeout' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_sslcert_gen_hash' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_transactionssent' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_transinqueue' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_transkeyval' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_transnew' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_transsend' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_uwait' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_validateidentifier' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_verifyconnection' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'm_verifysslcert' => [ + '5.1' => true, + 'extension' => 'mcve', + ], + 'dio_close' => [ + '5.1' => true, + 'extension' => 'dio', + ], + 'dio_fcntl' => [ + '5.1' => true, + 'extension' => 'dio', + ], + 'dio_open' => [ + '5.1' => true, + 'extension' => 'dio', + ], + 'dio_read' => [ + '5.1' => true, + 'extension' => 'dio', + ], + 'dio_seek' => [ + '5.1' => true, + 'extension' => 'dio', + ], + 'dio_stat' => [ + '5.1' => true, + 'extension' => 'dio', + ], + 'dio_tcsetattr' => [ + '5.1' => true, + 'extension' => 'dio', + ], + 'dio_truncate' => [ + '5.1' => true, + 'extension' => 'dio', + ], + 'dio_write' => [ + '5.1' => true, + 'extension' => 'dio', + ], + 'fam_cancel_monitor' => [ + '5.1' => true, + 'extension' => 'fam', + ], + 'fam_close' => [ + '5.1' => true, + 'extension' => 'fam', + ], + 'fam_monitor_collection' => [ + '5.1' => true, + 'extension' => 'fam', + ], + 'fam_monitor_directory' => [ + '5.1' => true, + 'extension' => 'fam', + ], + 'fam_monitor_file' => [ + '5.1' => true, + 'extension' => 'fam', + ], + 'fam_next_event' => [ + '5.1' => true, + 'extension' => 'fam', + ], + 'fam_open' => [ + '5.1' => true, + 'extension' => 'fam', + ], + 'fam_pending' => [ + '5.1' => true, + 'extension' => 'fam', + ], + 'fam_resume_monitor' => [ + '5.1' => true, + 'extension' => 'fam', + ], + 'fam_suspend_monitor' => [ + '5.1' => true, + 'extension' => 'fam', + ], + 'yp_all' => [ + '5.1' => true, + 'extension' => 'yp', + ], + 'yp_cat' => [ + '5.1' => true, + 'extension' => 'yp', + ], + 'yp_err_string' => [ + '5.1' => true, + 'extension' => 'yp', + ], + 'yp_errno' => [ + '5.1' => true, + 'extension' => 'yp', + ], + 'yp_first' => [ + '5.1' => true, + 'extension' => 'yp', + ], + 'yp_get_default_domain' => [ + '5.1' => true, + 'extension' => 'yp', + ], + 'yp_master' => [ + '5.1' => true, + 'extension' => 'yp', + ], + 'yp_match' => [ + '5.1' => true, + 'extension' => 'yp', + ], + 'yp_next' => [ + '5.1' => true, + 'extension' => 'yp', + ], + 'yp_order' => [ + '5.1' => true, + 'extension' => 'yp', + ], + 'udm_add_search_limit' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_alloc_agent_array' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_alloc_agent' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_api_version' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_cat_list' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_cat_path' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_check_charset' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_clear_search_limits' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_crc32' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_errno' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_error' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_find' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_free_agent' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_free_ispell_data' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_free_res' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_get_doc_count' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_get_res_field' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_get_res_param' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_hash32' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_load_ispell_data' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'udm_set_agent_param' => [ + '5.1' => true, + 'extension' => 'mnogosearch', + ], + 'w32api_deftype' => [ + '5.1' => true, + 'extension' => 'w32api', + ], + 'w32api_init_dtype' => [ + '5.1' => true, + 'extension' => 'w32api', + ], + 'w32api_invoke_function' => [ + '5.1' => true, + 'extension' => 'w32api', + ], + 'w32api_register_function' => [ + '5.1' => true, + 'extension' => 'w32api', + ], + 'w32api_set_call_method' => [ + '5.1' => true, + 'extension' => 'w32api', + ], + 'cpdf_add_annotation' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_add_outline' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_arc' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_begin_text' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_circle' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_clip' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_close' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_closepath_fill_stroke' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_closepath_stroke' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_closepath' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_continue_text' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_curveto' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_end_text' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_fill_stroke' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_fill' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_finalize_page' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_finalize' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_global_set_document_limits' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_import_jpeg' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_lineto' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_moveto' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_newpath' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_open' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_output_buffer' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_page_init' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_place_inline_image' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_rect' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_restore' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_rlineto' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_rmoveto' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_rotate_text' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_rotate' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_save_to_file' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_save' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_scale' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_action_url' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_char_spacing' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_creator' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_current_page' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_font_directories' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_font_map_file' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_font' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_horiz_scaling' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_keywords' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_leading' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_page_animation' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_subject' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_text_matrix' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_text_pos' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_text_rendering' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_text_rise' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_title' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_viewer_preferences' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_set_word_spacing' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_setdash' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_setflat' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_setgray_fill' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_setgray_stroke' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_setgray' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_setlinecap' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_setlinejoin' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_setlinewidth' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_setmiterlimit' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_setrgbcolor_fill' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_setrgbcolor_stroke' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_setrgbcolor' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_show_xy' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_show' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_stringwidth' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_stroke' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_text' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'cpdf_translate' => [ + '5.1' => true, + 'extension' => 'cpdf', + ], + 'ircg_channel_mode' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_disconnect' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_eval_ecmascript_params' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_fetch_error_msg' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_get_username' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_html_encode' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_ignore_add' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_ignore_del' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_invite' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_is_conn_alive' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_join' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_kick' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_list' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_lookup_format_messages' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_lusers' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_msg' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_names' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_nick' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_nickname_escape' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_nickname_unescape' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_notice' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_oper' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_part' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_pconnect' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_register_format_messages' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_set_current' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_set_file' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_set_on_die' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_topic' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_who' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'ircg_whois' => [ + '5.1' => true, + 'extension' => 'ircg', + ], + 'dbx_close' => [ + '5.1' => true, + 'extension' => 'dbx', + ], + 'dbx_compare' => [ + '5.1' => true, + 'extension' => 'dbx', + ], + 'dbx_connect' => [ + '5.1' => true, + 'extension' => 'dbx', + ], + 'dbx_error' => [ + '5.1' => true, + 'extension' => 'dbx', + ], + 'dbx_escape_string' => [ + '5.1' => true, + 'extension' => 'dbx', + ], + 'dbx_fetch_row' => [ + '5.1' => true, + 'extension' => 'dbx', + ], + 'dbx_query' => [ + '5.1' => true, + 'extension' => 'dbx', + ], + 'dbx_sort' => [ + '5.1' => true, + 'extension' => 'dbx', + ], + 'ingres_autocommit' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_close' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_commit' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_connect' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_fetch_array' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_fetch_object' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_fetch_row' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_field_length' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_field_name' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_field_nullable' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_field_precision' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_field_scale' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_field_type' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_num_fields' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_num_rows' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_pconnect' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_query' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ingres_rollback' => [ + '5.1' => true, + 'extension' => 'ingres', + ], + 'ovrimos_close' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_commit' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_connect' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_cursor' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_exec' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_execute' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_fetch_into' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_fetch_row' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_field_len' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_field_name' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_field_num' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_field_type' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_free_result' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_longreadlen' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_num_fields' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_num_rows' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_prepare' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_result_all' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_result' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_rollback' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ovrimos_close_all' => [ + '5.1' => true, + 'extension' => 'ovrimos', + ], + 'ora_bind' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_close' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_columnname' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_columnsize' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_columntype' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_commit' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_commitoff' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_commiton' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_do' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_error' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_errorcode' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_exec' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_fetch_into' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_fetch' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_getcolumn' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_logoff' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_logon' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_numcols' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_numrows' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_open' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_parse' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_plogon' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'ora_rollback' => [ + '5.1' => true, + 'extension' => 'oracle', + ], + 'mysqli_embedded_connect' => [ + '5.1' => true, + ], + 'mysqli_server_end' => [ + '5.1' => true, + ], + 'mysqli_server_init' => [ + '5.1' => true, + ], + + 'msession_connect' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_count' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_create' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_destroy' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_disconnect' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_find' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_get_array' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_get_data' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_get' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_inc' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_list' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_listvar' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_lock' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_plugin' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_randstr' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_set_array' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_set_data' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_set' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_timeout' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_uniq' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + 'msession_unlock' => [ + '5.1.3' => true, + 'extension' => 'msession', + ], + + 'mysqli_resource' => [ + '5.1.4' => true, + ], + + 'mysql_createdb' => [ + '5.1.7' => true, + 'extension' => 'mysql', + ], + 'mysql_dropdb' => [ + '5.1.7' => true, + 'extension' => 'mysql', + ], + 'mysql_listtables' => [ + '5.1.7' => true, + 'extension' => 'mysql', + ], + + 'hwapi_attribute_new' => [ + '5.2' => true, + 'extension' => 'hwapi', + ], + 'hwapi_content_new' => [ + '5.2' => true, + 'extension' => 'hwapi', + ], + 'hwapi_hgcsp' => [ + '5.2' => true, + 'extension' => 'hwapi', + ], + 'hwapi_object_new' => [ + '5.2' => true, + 'extension' => 'hwapi', + ], + 'filepro_fieldcount' => [ + '5.2' => true, + 'extension' => 'filepro', + ], + 'filepro_fieldname' => [ + '5.2' => true, + 'extension' => 'filepro', + ], + 'filepro_fieldtype' => [ + '5.2' => true, + 'extension' => 'filepro', + ], + 'filepro_fieldwidth' => [ + '5.2' => true, + 'extension' => 'filepro', + ], + 'filepro_retrieve' => [ + '5.2' => true, + 'extension' => 'filepro', + ], + 'filepro_rowcount' => [ + '5.2' => true, + 'extension' => 'filepro', + ], + 'filepro' => [ + '5.2' => true, + 'extension' => 'filepro', + ], + + 'ifx_affected_rows' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_blobinfile_mode' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_byteasvarchar' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_close' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_connect' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_copy_blob' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_create_blob' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_create_char' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_do' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_error' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_errormsg' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_fetch_row' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_fieldproperties' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_fieldtypes' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_free_blob' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_free_char' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_free_result' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_get_blob' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_get_char' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_getsqlca' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_htmltbl_result' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_nullformat' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_num_fields' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_num_rows' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_pconnect' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_prepare' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_query' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_textasvarchar' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_update_blob' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifx_update_char' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifxus_close_slob' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifxus_create_slob' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifxus_free_slob' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifxus_open_slob' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifxus_read_slob' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifxus_seek_slob' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifxus_tell_slob' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + 'ifxus_write_slob' => [ + '5.2.1' => true, + 'extension' => 'ifx', + ], + + 'ncurses_addch' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_addchnstr' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_addchstr' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_addnstr' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_addstr' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_assume_default_colors' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_attroff' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_attron' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_attrset' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_baudrate' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_beep' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_bkgd' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_bkgdset' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_border' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_bottom_panel' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_can_change_color' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_cbreak' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_clear' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_clrtobot' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_clrtoeol' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_color_content' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_color_set' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_curs_set' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_def_prog_mode' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_def_shell_mode' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_define_key' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_del_panel' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_delay_output' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_delch' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_deleteln' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_delwin' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_doupdate' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_echo' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_echochar' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_end' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_erase' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_erasechar' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_filter' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_flash' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_flushinp' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_getch' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_getmaxyx' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_getmouse' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_getyx' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_halfdelay' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_has_colors' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_has_ic' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_has_il' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_has_key' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_hide_panel' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_hline' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_inch' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_init_color' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_init_pair' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_init' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_insch' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_insdelln' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_insertln' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_insstr' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_instr' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_isendwin' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_keyok' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_keypad' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_killchar' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_longname' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_meta' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_mouse_trafo' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_mouseinterval' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_mousemask' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_move_panel' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_move' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_mvaddch' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_mvaddchnstr' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_mvaddchstr' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_mvaddnstr' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_mvaddstr' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_mvcur' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_mvdelch' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_mvgetch' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_mvhline' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_mvinch' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_mvvline' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_mvwaddstr' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_napms' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_new_panel' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_newpad' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_newwin' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_nl' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_nocbreak' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_noecho' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_nonl' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_noqiflush' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_noraw' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_pair_content' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_panel_above' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_panel_below' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_panel_window' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_pnoutrefresh' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_prefresh' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_putp' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_qiflush' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_raw' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_refresh' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_replace_panel' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_reset_prog_mode' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_reset_shell_mode' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_resetty' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_savetty' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_scr_dump' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_scr_init' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_scr_restore' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_scr_set' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_scrl' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_show_panel' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_slk_attr' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_slk_attroff' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_slk_attron' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_slk_attrset' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_slk_clear' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_slk_color' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_slk_init' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_slk_noutrefresh' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_slk_refresh' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_slk_restore' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_slk_set' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_slk_touch' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_standend' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_standout' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_start_color' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_termattrs' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_termname' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_timeout' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_top_panel' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_typeahead' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_ungetch' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_ungetmouse' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_update_panels' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_use_default_colors' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_use_env' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_use_extended_names' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_vidattr' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_vline' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_waddch' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_waddstr' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_wattroff' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_wattron' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_wattrset' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_wborder' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_wclear' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_wcolor_set' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_werase' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_wgetch' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_whline' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_wmouse_trafo' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_wmove' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_wnoutrefresh' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_wrefresh' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_wstandend' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_wstandout' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'ncurses_wvline' => [ + '5.3' => true, + 'extension' => 'ncurses', + ], + 'fdf_add_doc_javascript' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_add_template' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_close' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_create' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_enum_values' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_errno' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_error' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_get_ap' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_get_attachment' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_get_encoding' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_get_file' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_get_flags' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_get_opt' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_get_status' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_get_value' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_get_version' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_header' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_next_field_name' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_open_string' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_open' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_remove_item' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_save_string' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_save' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_set_ap' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_set_encoding' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_set_file' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_set_flags' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_set_javascript_action' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_set_on_import_javascript' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_set_opt' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_set_status' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_set_submit_form_action' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_set_target_frame' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_set_value' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'fdf_set_version' => [ + '5.3' => true, + 'extension' => 'fdf', + ], + 'ming_keypress' => [ + '5.3' => true, + 'extension' => 'ming', + ], + 'ming_setcubicthreshold' => [ + '5.3' => true, + 'extension' => 'ming', + ], + 'ming_setscale' => [ + '5.3' => true, + 'extension' => 'ming', + ], + 'ming_setswfcompression' => [ + '5.3' => true, + 'extension' => 'ming', + ], + 'ming_useconstants' => [ + '5.3' => true, + 'extension' => 'ming', + ], + 'ming_useswfversion' => [ + '5.3' => true, + 'extension' => 'ming', + ], + 'dbase_add_record' => [ + '5.3' => true, + 'extension' => 'dbase', + ], + 'dbase_close' => [ + '5.3' => true, + 'extension' => 'dbase', + ], + 'dbase_create' => [ + '5.3' => true, + 'extension' => 'dbase', + ], + 'dbase_delete_record' => [ + '5.3' => true, + 'extension' => 'dbase', + ], + 'dbase_get_header_info' => [ + '5.3' => true, + 'extension' => 'dbase', + ], + 'dbase_get_record_with_names' => [ + '5.3' => true, + 'extension' => 'dbase', + ], + 'dbase_get_record' => [ + '5.3' => true, + 'extension' => 'dbase', + ], + 'dbase_numfields' => [ + '5.3' => true, + 'extension' => 'dbase', + ], + 'dbase_numrecords' => [ + '5.3' => true, + 'extension' => 'dbase', + ], + 'dbase_open' => [ + '5.3' => true, + 'extension' => 'dbase', + ], + 'dbase_pack' => [ + '5.3' => true, + 'extension' => 'dbase', + ], + 'dbase_replace_record' => [ + '5.3' => true, + 'extension' => 'dbase', + ], + 'fbsql_affected_rows' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_autocommit' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_blob_size' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_change_user' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_clob_size' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_close' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_commit' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_connect' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_create_blob' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_create_clob' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_create_db' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_data_seek' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_database_password' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_database' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_db_query' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_db_status' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_drop_db' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_errno' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_error' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_fetch_array' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_fetch_assoc' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_fetch_field' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_fetch_lengths' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_fetch_object' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_fetch_row' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_field_flags' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_field_len' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_field_name' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_field_seek' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_field_table' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_field_type' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_free_result' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_get_autostart_info' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_hostname' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_insert_id' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_list_dbs' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_list_fields' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_list_tables' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_next_result' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_num_fields' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_num_rows' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_password' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_pconnect' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_query' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_read_blob' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_read_clob' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_result' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_rollback' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_rows_fetched' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_select_db' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_set_characterset' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_set_lob_mode' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_set_password' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_set_transaction' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_start_db' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_stop_db' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_table_name' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_tablename' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_username' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'fbsql_warnings' => [ + '5.3' => true, + 'extension' => 'fbsql', + ], + 'msql_affected_rows' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_close' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_connect' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_create_db' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_createdb' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_data_seek' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_db_query' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_dbname' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_drop_db' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_error' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_fetch_array' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_fetch_field' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_fetch_object' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_fetch_row' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_field_flags' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_field_len' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_field_name' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_field_seek' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_field_table' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_field_type' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_fieldflags' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_fieldlen' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_fieldname' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_fieldtable' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_fieldtype' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_free_result' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_list_dbs' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_list_fields' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_list_tables' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_num_fields' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_num_rows' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_numfields' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_numrows' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_pconnect' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_query' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_regcase' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_result' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_select_db' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql_tablename' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'msql' => [ + '5.3' => true, + 'extension' => 'msql', + ], + 'mysqli_disable_reads_from_master' => [ + '5.3' => true, + ], + 'mysqli_disable_rpl_parse' => [ + '5.3' => true, + ], + 'mysqli_enable_reads_from_master' => [ + '5.3' => true, + ], + 'mysqli_enable_rpl_parse' => [ + '5.3' => true, + ], + 'mysqli_master_query' => [ + '5.3' => true, + ], + 'mysqli_rpl_parse_enabled' => [ + '5.3' => true, + ], + 'mysqli_rpl_probe' => [ + '5.3' => true, + ], + 'mysqli_slave_query' => [ + '5.3' => true, + ], + + 'call_user_method' => [ + '4.1' => false, + '7.0' => true, + 'alternative' => 'call_user_func()', + ], + 'call_user_method_array' => [ + '4.1' => false, + '7.0' => true, + 'alternative' => 'call_user_func_array()', + ], + 'define_syslog_variables' => [ + '5.3' => false, + '5.4' => true, + ], + 'dl' => [ + '5.3' => false, + ], + 'ereg' => [ + '5.3' => false, + '7.0' => true, + 'alternative' => 'preg_match()', + 'extension' => 'ereg', + ], + 'ereg_replace' => [ + '5.3' => false, + '7.0' => true, + 'alternative' => 'preg_replace()', + 'extension' => 'ereg', + ], + 'eregi' => [ + '5.3' => false, + '7.0' => true, + 'alternative' => 'preg_match() (with the i modifier)', + 'extension' => 'ereg', + ], + 'eregi_replace' => [ + '5.3' => false, + '7.0' => true, + 'alternative' => 'preg_replace() (with the i modifier)', + 'extension' => 'ereg', + ], + 'imagepsbbox' => [ + '7.0' => true, + ], + 'imagepsencodefont' => [ + '7.0' => true, + ], + 'imagepsextendfont' => [ + '7.0' => true, + ], + 'imagepsfreefont' => [ + '7.0' => true, + ], + 'imagepsloadfont' => [ + '7.0' => true, + ], + 'imagepsslantfont' => [ + '7.0' => true, + ], + 'imagepstext' => [ + '7.0' => true, + ], + 'import_request_variables' => [ + '5.3' => false, + '5.4' => true, + ], + 'ldap_sort' => [ + '7.0' => false, + '8.0' => true, + ], + 'mcrypt_generic_end' => [ + '5.3' => false, + '7.0' => true, + 'alternative' => 'mcrypt_generic_deinit()', + 'extension' => 'mcrypt', + ], + 'mysql_db_query' => [ + '5.3' => false, + '7.0' => true, + 'alternative' => 'mysqli::select_db() and mysqli::query()', + 'extension' => 'mysql', + ], + 'mysql_escape_string' => [ + '4.3' => false, + '7.0' => true, + 'alternative' => 'mysqli::real_escape_string()', + 'extension' => 'mysql', + ], + 'mysql_list_dbs' => [ + '5.4' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_list_fields' => [ + '5.4' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysqli_bind_param' => [ + '5.3' => false, + '5.4' => true, + 'alternative' => 'mysqli_stmt::bind_param()', + ], + 'mysqli_bind_result' => [ + '5.3' => false, + '5.4' => true, + 'alternative' => 'mysqli_stmt::bind_result()', + ], + 'mysqli_client_encoding' => [ + '5.3' => false, + '5.4' => true, + 'alternative' => 'mysqli::character_set_name()', + ], + 'mysqli_fetch' => [ + '5.3' => false, + '5.4' => true, + 'alternative' => 'mysqli_stmt::fetch()', + ], + 'mysqli_param_count' => [ + '5.3' => false, + '5.4' => true, + 'alternative' => 'mysqli_stmt_param_count()', + ], + 'mysqli_get_metadata' => [ + '5.3' => false, + '5.4' => true, + 'alternative' => 'mysqli_stmt::result_metadata()', + ], + 'mysqli_send_long_data' => [ + '5.3' => false, + '5.4' => true, + 'alternative' => 'mysqli_stmt::send_long_data()', + ], + 'magic_quotes_runtime' => [ + '5.3' => false, + '7.0' => true, + ], + 'session_register' => [ + '5.3' => false, + '5.4' => true, + 'alternative' => '$_SESSION', + ], + 'session_unregister' => [ + '5.3' => false, + '5.4' => true, + 'alternative' => '$_SESSION', + ], + 'session_is_registered' => [ + '5.3' => false, + '5.4' => true, + 'alternative' => '$_SESSION', + ], + 'set_magic_quotes_runtime' => [ + '5.3' => false, + '7.0' => true, + ], + 'set_socket_blocking' => [ + '5.3' => false, + '7.0' => true, + 'alternative' => 'stream_set_blocking()', + ], + 'split' => [ + '5.3' => false, + '7.0' => true, + 'alternative' => 'preg_split(), explode() or str_split()', + 'extension' => 'ereg', + ], + 'spliti' => [ + '5.3' => false, + '7.0' => true, + 'alternative' => 'preg_split() (with the i modifier)', + 'extension' => 'ereg', + ], + 'sql_regcase' => [ + '5.3' => false, + '7.0' => true, + 'extension' => 'ereg', + ], + 'php_logo_guid' => [ + '5.5' => true, + ], + 'php_egg_logo_guid' => [ + '5.5' => true, + ], + 'php_real_logo_guid' => [ + '5.5' => true, + ], + 'zend_logo_guid' => [ + '5.5' => true, + 'alternative' => 'text string "PHPE9568F35-D428-11d2-A769-00AA001ACF42"', + ], + 'datefmt_set_timezone_id' => [ + '5.5' => false, + '7.0' => true, + 'alternative' => 'IntlDateFormatter::setTimeZone()', + ], + 'mcrypt_ecb' => [ + '5.5' => false, + '7.0' => true, + 'alternative' => 'mcrypt_decrypt()/mcrypt_encrypt()', + 'extension' => 'mcrypt', + ], + 'mcrypt_cbc' => [ + '5.5' => false, + '7.0' => true, + 'alternative' => 'mcrypt_decrypt()/mcrypt_encrypt()', + 'extension' => 'mcrypt', + ], + 'mcrypt_cfb' => [ + '5.5' => false, + '7.0' => true, + 'alternative' => 'mcrypt_decrypt()/mcrypt_encrypt()', + 'extension' => 'mcrypt', + ], + 'mcrypt_ofb' => [ + '5.5' => false, + '7.0' => true, + 'alternative' => 'mcrypt_decrypt()/mcrypt_encrypt()', + 'extension' => 'mcrypt', + ], + 'ocibindbyname' => [ + '5.4' => false, + 'alternative' => 'oci_bind_by_name()', + ], + 'ocicancel' => [ + '5.4' => false, + 'alternative' => 'oci_cancel()', + ], + 'ocicloselob' => [ + '5.4' => false, + 'alternative' => 'OCI-Lob::close() / OCILob::close() (PHP 8+)', + ], + 'ocicollappend' => [ + '5.4' => false, + 'alternative' => 'OCI-Collection::append() / OCICollection::append() (PHP 8+)', + ], + 'ocicollassign' => [ + '5.4' => false, + 'alternative' => 'OCI-Collection::assign() / OCICollection::assign() (PHP 8+)', + ], + 'ocicollassignelem' => [ + '5.4' => false, + 'alternative' => 'OCI-Collection::assignElem() / OCICollection::assignElem() (PHP 8+)', + ], + 'ocicollgetelem' => [ + '5.4' => false, + 'alternative' => 'OCI-Collection::getElem() / OCICollection::getElem() (PHP 8+)', + ], + 'ocicollmax' => [ + '5.4' => false, + 'alternative' => 'OCI-Collection::max() / OCICollection::max() (PHP 8+)', + ], + 'ocicollsize' => [ + '5.4' => false, + 'alternative' => 'OCI-Collection::size() / OCICollection::size() (PHP 8+)', + ], + 'ocicolltrim' => [ + '5.4' => false, + 'alternative' => 'OCI-Collection::trim() / OCICollection::trim() (PHP 8+)', + ], + 'ocicolumnisnull' => [ + '5.4' => false, + 'alternative' => 'oci_field_is_null()', + ], + 'ocicolumnname' => [ + '5.4' => false, + 'alternative' => 'oci_field_name()', + ], + 'ocicolumnprecision' => [ + '5.4' => false, + 'alternative' => 'oci_field_precision()', + ], + 'ocicolumnscale' => [ + '5.4' => false, + 'alternative' => 'oci_field_scale()', + ], + 'ocicolumnsize' => [ + '5.4' => false, + 'alternative' => 'oci_field_size()', + ], + 'ocicolumntype' => [ + '5.4' => false, + 'alternative' => 'oci_field_type()', + ], + 'ocicolumntyperaw' => [ + '5.4' => false, + 'alternative' => 'oci_field_type_raw()', + ], + 'ocicommit' => [ + '5.4' => false, + 'alternative' => 'oci_commit()', + ], + 'ocidefinebyname' => [ + '5.4' => false, + 'alternative' => 'oci_define_by_name()', + ], + 'ocierror' => [ + '5.4' => false, + 'alternative' => 'oci_error()', + ], + 'ociexecute' => [ + '5.4' => false, + 'alternative' => 'oci_execute()', + ], + 'ocifetch' => [ + '5.4' => false, + 'alternative' => 'oci_fetch()', + ], + 'ocifetchinto' => [ + '5.4' => false, + ], + 'ocifetchstatement' => [ + '5.4' => false, + 'alternative' => 'oci_fetch_all()', + ], + 'ocifreecollection' => [ + '5.4' => false, + 'alternative' => 'OCI-Collection::free() / OCICollection::free() (PHP 8+)', + ], + 'ocifreecursor' => [ + '5.4' => false, + 'alternative' => 'oci_free_statement()', + ], + 'ocifreedesc' => [ + '5.4' => false, + 'alternative' => 'OCI-Lob::free() / OCILob::free() (PHP 8+)', + ], + 'ocifreestatement' => [ + '5.4' => false, + 'alternative' => 'oci_free_statement()', + ], + 'ociinternaldebug' => [ + '5.4' => false, + '8.0' => true, + 'alternative' => 'oci_internal_debug() (PHP < 8.0)', + ], + 'ociloadlob' => [ + '5.4' => false, + 'alternative' => 'OCI-Lob::load() / OCILob::load() (PHP 8+)', + ], + 'ocilogoff' => [ + '5.4' => false, + 'alternative' => 'oci_close()', + ], + 'ocilogon' => [ + '5.4' => false, + 'alternative' => 'oci_connect()', + ], + 'ocinewcollection' => [ + '5.4' => false, + 'alternative' => 'oci_new_collection()', + ], + 'ocinewcursor' => [ + '5.4' => false, + 'alternative' => 'oci_new_cursor()', + ], + 'ocinewdescriptor' => [ + '5.4' => false, + 'alternative' => 'oci_new_descriptor()', + ], + 'ocinlogon' => [ + '5.4' => false, + 'alternative' => 'oci_new_connect()', + ], + 'ocinumcols' => [ + '5.4' => false, + 'alternative' => 'oci_num_fields()', + ], + 'ociparse' => [ + '5.4' => false, + 'alternative' => 'oci_parse()', + ], + 'ociplogon' => [ + '5.4' => false, + 'alternative' => 'oci_pconnect()', + ], + 'ociresult' => [ + '5.4' => false, + 'alternative' => 'oci_result()', + ], + 'ocirollback' => [ + '5.4' => false, + 'alternative' => 'oci_rollback()', + ], + 'ocirowcount' => [ + '5.4' => false, + 'alternative' => 'oci_num_rows()', + ], + 'ocisavelob' => [ + '5.4' => false, + 'alternative' => 'OCI-Lob::save() / OCILob::save() (PHP 8+)', + ], + 'ocisavelobfile' => [ + '5.4' => false, + 'alternative' => 'OCI-Lob::import() / OCILob::import() (PHP 8+)', + ], + 'ociserverversion' => [ + '5.4' => false, + 'alternative' => 'oci_server_version()', + ], + 'ocisetprefetch' => [ + '5.4' => false, + 'alternative' => 'oci_set_prefetch()', + ], + 'ocistatementtype' => [ + '5.4' => false, + 'alternative' => 'oci_statement_type()', + ], + 'ociwritelobtofile' => [ + '5.4' => false, + 'alternative' => 'OCI-Lob::export() / OCILob::export() (PHP 8+)', + ], + 'ociwritetemporarylob' => [ + '5.4' => false, + 'alternative' => 'OCI-Lob::writeTemporary() / OCILob::writeTemporary() (PHP 8+)', + ], + 'mysqli_get_cache_stats' => [ + '5.4' => true, + ], + 'sqlite_array_query' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_busy_timeout' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_changes' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_close' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_column' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_create_aggregate' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_create_function' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_current' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_error_string' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_escape_string' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_exec' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_factory' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_fetch_all' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_fetch_array' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_fetch_column_types' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_fetch_object' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_fetch_single' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_fetch_string' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_field_name' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_has_more' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_has_prev' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_key' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_last_error' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_last_insert_rowid' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_libencoding' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_libversion' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_next' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_num_fields' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_num_rows' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_open' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_popen' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_prev' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_query' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_rewind' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_seek' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_single_query' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_udf_decode_binary' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_udf_encode_binary' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_unbuffered_query' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + 'sqlite_valid' => [ + '5.4' => true, + 'extension' => 'sqlite', + ], + + 'mssql_bind' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_close' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_connect' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_data_seek' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_execute' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_fetch_array' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_fetch_assoc' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_fetch_batch' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_fetch_field' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_fetch_object' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_fetch_row' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_field_length' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_field_name' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_field_seek' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_field_type' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_free_result' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_free_statement' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_get_last_message' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_guid_string' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_init' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_min_error_severity' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_min_message_severity' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_next_result' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_num_fields' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_num_rows' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_pconnect' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_query' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_result' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_rows_affected' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mssql_select_db' => [ + '7.0' => true, + 'extension' => 'mssql', + ], + 'mysql_affected_rows' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_client_encoding' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_close' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_connect' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_create_db' => [ + '4.3' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_data_seek' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_db_name' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_drop_db' => [ + '4.3' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_errno' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_error' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_fetch_array' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_fetch_assoc' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_fetch_field' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_fetch_lengths' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_fetch_object' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_fetch_row' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_field_flags' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_field_len' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_field_name' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_field_seek' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_field_table' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_field_type' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_free_result' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_get_client_info' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_get_host_info' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_get_proto_info' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_get_server_info' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_info' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_insert_id' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_list_processes' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_list_tables' => [ + '4.3.7' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_num_fields' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_num_rows' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_pconnect' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_ping' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_query' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_real_escape_string' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_result' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_select_db' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_set_charset' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_stat' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_tablename' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_thread_id' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_unbuffered_query' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_fieldname' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_fieldtable' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_fieldlen' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_fieldtype' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_fieldflags' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_selectdb' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_freeresult' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_numfields' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_numrows' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_listdbs' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_listfields' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_dbname' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'mysql_table_name' => [ + '5.5' => false, + '7.0' => true, + 'extension' => 'mysql', + ], + 'sybase_affected_rows' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_close' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_connect' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_data_seek' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_deadlock_retry_count' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_fetch_array' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_fetch_assoc' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_fetch_field' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_fetch_object' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_fetch_row' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_field_seek' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_free_result' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_get_last_message' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_min_client_severity' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_min_error_severity' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_min_message_severity' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_min_server_severity' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_num_fields' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_num_rows' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_pconnect' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_query' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_result' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_select_db' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_set_message_handler' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + 'sybase_unbuffered_query' => [ + '7.0' => true, + 'extension' => 'sybase', + ], + + 'mcrypt_create_iv' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'random_bytes() or OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_decrypt' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_enc_get_algorithms_name' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_enc_get_block_size' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_enc_get_iv_size' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_enc_get_key_size' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_enc_get_modes_name' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_enc_get_supported_key_sizes' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_enc_is_block_algorithm_mode' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_enc_is_block_algorithm' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_enc_is_block_mode' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_enc_self_test' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_encrypt' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_generic_deinit' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_generic_init' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_generic' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_get_block_size' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_get_cipher_name' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_get_iv_size' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_get_key_size' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_list_algorithms' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_list_modes' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_module_close' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_module_get_algo_block_size' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_module_get_algo_key_size' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_module_get_supported_key_sizes' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_module_is_block_algorithm_mode' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_module_is_block_algorithm' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_module_is_block_mode' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_module_open' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mcrypt_module_self_test' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'mdecrypt_generic' => [ + '7.1' => false, + '7.2' => true, + 'alternative' => 'OpenSSL', + 'extension' => 'mcrypt', + ], + 'jpeg2wbmp' => [ + '7.2' => false, + '8.0' => true, + 'alternative' => 'imagecreatefromjpeg() and imagewbmp()', + ], + 'png2wbmp' => [ + '7.2' => false, + '8.0' => true, + 'alternative' => 'imagecreatefrompng() or imagewbmp()', + ], + '__autoload' => [ + '7.2' => false, + 'alternative' => 'SPL autoload', + ], + 'create_function' => [ + '7.2' => false, + '8.0' => true, + 'alternative' => 'an anonymous function', + ], + 'each' => [ + '7.2' => false, + '8.0' => true, + 'alternative' => 'a foreach loop or ArrayIterator', + ], + 'gmp_random' => [ + '7.2' => false, + '8.0' => true, + 'alternative' => 'gmp_random_bits() or gmp_random_range()', + ], + 'read_exif_data' => [ + '7.2' => false, + '8.0' => true, + 'alternative' => 'exif_read_data()', + ], + + 'image2wbmp' => [ + '7.3' => false, + '8.0' => true, + 'alternative' => 'imagewbmp()', + ], + 'mbregex_encoding' => [ + '7.3' => false, + '8.0' => true, + 'alternative' => 'mb_regex_encoding()', + ], + 'mbereg' => [ + '7.3' => false, + '8.0' => true, + 'alternative' => 'mb_ereg()', + ], + 'mberegi' => [ + '7.3' => false, + '8.0' => true, + 'alternative' => 'mb_eregi()', + ], + 'mbereg_replace' => [ + '7.3' => false, + '8.0' => true, + 'alternative' => 'mb_ereg_replace()', + ], + 'mberegi_replace' => [ + '7.3' => false, + '8.0' => true, + 'alternative' => 'mb_eregi_replace()', + ], + 'mbsplit' => [ + '7.3' => false, + '8.0' => true, + 'alternative' => 'mb_split()', + ], + 'mbereg_match' => [ + '7.3' => false, + '8.0' => true, + 'alternative' => 'mb_ereg_match()', + ], + 'mbereg_search' => [ + '7.3' => false, + '8.0' => true, + 'alternative' => 'mb_ereg_search()', + ], + 'mbereg_search_pos' => [ + '7.3' => false, + '8.0' => true, + 'alternative' => 'mb_ereg_search_pos()', + ], + 'mbereg_search_regs' => [ + '7.3' => false, + '8.0' => true, + 'alternative' => 'mb_ereg_search_regs()', + ], + 'mbereg_search_init' => [ + '7.3' => false, + '8.0' => true, + 'alternative' => 'mb_ereg_search_init()', + ], + 'mbereg_search_getregs' => [ + '7.3' => false, + '8.0' => true, + 'alternative' => 'mb_ereg_search_getregs()', + ], + 'mbereg_search_getpos' => [ + '7.3' => false, + '8.0' => true, + 'alternative' => 'mb_ereg_search_getpos()', + ], + 'mbereg_search_setpos' => [ + '7.3' => false, + '8.0' => true, + 'alternative' => 'mb_ereg_search_setpos()', + ], + 'fgetss' => [ + '7.3' => false, + '8.0' => true, + ], + 'gzgetss' => [ + '7.3' => false, + '8.0' => true, + ], + + 'convert_cyr_string' => [ + '7.4' => false, + '8.0' => true, + 'alternative' => 'mb_convert_encoding(), iconv() or UConverter', + ], + 'ezmlm_hash' => [ + '7.4' => false, + '8.0' => true, + ], + 'get_magic_quotes_gpc' => [ + '7.4' => false, + '8.0' => true, + ], + 'get_magic_quotes_runtime' => [ + '7.4' => false, + '8.0' => true, + ], + 'hebrevc' => [ + '7.4' => false, + '8.0' => true, + ], + 'is_real' => [ + '7.4' => false, + 'alternative' => 'is_float()', + ], + 'money_format' => [ + '7.4' => false, + '8.0' => true, + 'alternative' => 'NumberFormatter::formatCurrency()', + ], + 'restore_include_path' => [ + '7.4' => false, + '8.0' => true, + 'alternative' => "ini_restore('include_path')", + ], + 'ibase_add_user' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_affected_rows' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_backup' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_blob_add' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_blob_cancel' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_blob_close' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_blob_create' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_blob_echo' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_blob_get' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_blob_import' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_blob_info' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_blob_open' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_close' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_commit_ret' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_commit' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_connect' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_db_info' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_delete_user' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_drop_db' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_errcode' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_errmsg' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_execute' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_fetch_assoc' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_fetch_object' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_fetch_row' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_field_info' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_free_event_handler' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_free_query' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_free_result' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_gen_id' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_maintain_db' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_modify_user' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_name_result' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_num_fields' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_num_params' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_param_info' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_pconnect' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_prepare' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_query' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_restore' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_rollback_ret' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_rollback' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_server_info' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_service_attach' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_service_detach' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_set_event_handler' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_trans' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'ibase_wait_event' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_add_user' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_affected_rows' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_backup' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_blob_add' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_blob_cancel' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_blob_close' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_blob_create' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_blob_echo' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_blob_get' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_blob_import' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_blob_info' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_blob_open' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_close' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_commit_ret' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_commit' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_connect' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_db_info' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_delete_user' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_drop_db' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_errcode' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_errmsg' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_execute' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_fetch_assoc' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_fetch_object' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_fetch_row' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_field_info' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_free_event_handler' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_free_query' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_free_result' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_gen_id' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_maintain_db' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_modify_user' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_name_result' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_num_fields' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_num_params' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_param_info' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_pconnect' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_prepare' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_query' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_restore' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_rollback_ret' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_rollback' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_server_info' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_service_attach' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_service_detach' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_set_event_handler' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_trans' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + 'fbird_wait_event' => [ + '7.4' => true, + 'extension' => 'ibase', + ], + + 'ldap_control_paged_result_response' => [ + '7.4' => false, + '8.0' => true, + 'alternative' => 'ldap_search()', + ], + 'ldap_control_paged_result' => [ + '7.4' => false, + '8.0' => true, + 'alternative' => 'ldap_search()', + ], + 'recode_file' => [ + '7.4' => true, + 'alternative' => 'the iconv or mbstring extension', + 'extension' => 'recode', + ], + 'recode_string' => [ + '7.4' => true, + 'alternative' => 'the iconv or mbstring extension', + 'extension' => 'recode', + ], + 'recode' => [ + '7.4' => true, + 'alternative' => 'the iconv or mbstring extension', + 'extension' => 'recode', + ], + 'wddx_add_vars' => [ + '7.4' => true, + 'extension' => 'wddx', + ], + 'wddx_deserialize' => [ + '7.4' => true, + 'extension' => 'wddx', + ], + 'wddx_packet_end' => [ + '7.4' => true, + 'extension' => 'wddx', + ], + 'wddx_packet_start' => [ + '7.4' => true, + 'extension' => 'wddx', + ], + 'wddx_serialize_value' => [ + '7.4' => true, + 'extension' => 'wddx', + ], + 'wddx_serialize_vars' => [ + '7.4' => true, + 'extension' => 'wddx', + ], + 'mysqli_embedded_server_end' => [ + '7.4' => true, + ], + 'mysqli_embedded_server_start' => [ + '7.4' => true, + ], + + 'enchant_broker_get_dict_path' => [ + '8.0' => false, + ], + 'enchant_broker_set_dict_path' => [ + '8.0' => false, + ], + 'enchant_broker_free' => [ + '8.0' => false, + 'alternative' => 'unset the object', + ], + 'enchant_broker_free_dict' => [ + '8.0' => false, + 'alternative' => 'unset the object', + ], + 'enchant_dict_add_to_personal' => [ + '8.0' => false, + 'alternative' => 'enchant_dict_add()', + ], + 'enchant_dict_is_in_session' => [ + '8.0' => false, + 'alternative' => 'enchant_dict_is_added()', + ], + 'imap_header' => [ + '8.0' => true, + 'alternative' => 'imap_headerinfo()', + ], + 'libxml_disable_entity_loader' => [ + '8.0' => false, + ], + 'oci_internal_debug' => [ + '8.0' => true, + ], + 'openssl_x509_free' => [ + '8.0' => false, + ], + 'openssl_pkey_free' => [ + '8.0' => false, + ], + 'openssl_free_key' => [ + '8.0' => false, + ], + 'pg_clientencoding' => [ + '8.0' => false, + 'alternative' => 'pg_client_encoding()', + ], + 'pg_cmdtuples' => [ + '8.0' => false, + 'alternative' => 'pg_affected_rows()', + ], + 'pg_errormessage' => [ + '8.0' => false, + 'alternative' => 'pg_last_error()', + ], + 'pg_fieldname' => [ + '8.0' => false, + 'alternative' => 'pg_field_name()', + ], + 'pg_fieldnum' => [ + '8.0' => false, + 'alternative' => 'pg_field_num()', + ], + 'pg_fieldisnull' => [ + '8.0' => false, + 'alternative' => 'pg_field_is_null()', + ], + 'pg_fieldprtlen' => [ + '8.0' => false, + 'alternative' => 'pg_field_prtlen()', + ], + 'pg_fieldsize' => [ + '8.0' => false, + 'alternative' => 'pg_field_size()', + ], + 'pg_fieldtype' => [ + '8.0' => false, + 'alternative' => 'pg_field_type()', + ], + 'pg_freeresult' => [ + '8.0' => false, + 'alternative' => 'pg_free_result()', + ], + 'pg_getlastoid' => [ + '8.0' => false, + 'alternative' => 'pg_last_oid()', + ], + 'pg_loclose' => [ + '8.0' => false, + 'alternative' => 'pg_lo_close()', + ], + 'pg_locreate' => [ + '8.0' => false, + 'alternative' => 'pg_lo_create()', + ], + 'pg_loexport' => [ + '8.0' => false, + 'alternative' => 'pg_lo_export()', + ], + 'pg_loimport' => [ + '8.0' => false, + 'alternative' => 'pg_lo_import()', + ], + 'pg_loopen' => [ + '8.0' => false, + 'alternative' => 'pg_lo_open()', + ], + 'pg_loread' => [ + '8.0' => false, + 'alternative' => 'pg_lo_read()', + ], + 'pg_loreadall' => [ + '8.0' => false, + 'alternative' => 'pg_lo_read_all()', + ], + 'pg_lounlink' => [ + '8.0' => false, + 'alternative' => 'pg_lo_unlink()', + ], + 'pg_lowrite' => [ + '8.0' => false, + 'alternative' => 'pg_lo_write()', + ], + 'pg_numfields' => [ + '8.0' => false, + 'alternative' => 'pg_num_fields()', + ], + 'pg_numrows' => [ + '8.0' => false, + 'alternative' => 'pg_num_rows()', + ], + 'pg_result' => [ + '8.0' => false, + 'alternative' => 'pg_fetch_result()', + ], + 'pg_setclientencoding' => [ + '8.0' => false, + 'alternative' => 'pg_set_client_encoding()', + ], + 'shmop_close' => [ + '8.0' => false, + ], + 'xmlrpc_decode_request' => [ + '8.0' => true, + 'extension' => 'xmlrpc', + ], + 'xmlrpc_decode' => [ + '8.0' => true, + 'extension' => 'xmlrpc', + ], + 'xmlrpc_encode_request' => [ + '8.0' => true, + 'extension' => 'xmlrpc', + ], + 'xmlrpc_encode' => [ + '8.0' => true, + 'extension' => 'xmlrpc', + ], + 'xmlrpc_get_type' => [ + '8.0' => true, + 'extension' => 'xmlrpc', + ], + 'xmlrpc_is_fault' => [ + '8.0' => true, + 'extension' => 'xmlrpc', + ], + 'xmlrpc_parse_method_descriptions' => [ + '8.0' => true, + 'extension' => 'xmlrpc', + ], + 'xmlrpc_server_add_introspection_data' => [ + '8.0' => true, + 'extension' => 'xmlrpc', + ], + 'xmlrpc_server_call_method' => [ + '8.0' => true, + 'extension' => 'xmlrpc', + ], + 'xmlrpc_server_create' => [ + '8.0' => true, + 'extension' => 'xmlrpc', + ], + 'xmlrpc_server_destroy' => [ + '8.0' => true, + 'extension' => 'xmlrpc', + ], + 'xmlrpc_server_register_introspection_callback' => [ + '8.0' => true, + 'extension' => 'xmlrpc', + ], + 'xmlrpc_server_register_method' => [ + '8.0' => true, + 'extension' => 'xmlrpc', + ], + 'xmlrpc_set_type' => [ + '8.0' => true, + 'extension' => 'xmlrpc', + ], + 'zip_close' => [ + '8.0' => false, + 'alternative' => 'ZipArchive::close()', + ], + 'zip_entry_close' => [ + '8.0' => false, + 'alternative' => 'ZipArchive', + ], + 'zip_entry_compressedsize' => [ + '8.0' => false, + 'alternative' => 'ZipArchive', + ], + 'zip_entry_compressionmethod' => [ + '8.0' => false, + 'alternative' => 'ZipArchive', + ], + 'zip_entry_filesize' => [ + '8.0' => false, + 'alternative' => 'ZipArchive', + ], + 'zip_entry_name' => [ + '8.0' => false, + 'alternative' => 'ZipArchive', + ], + 'zip_entry_open' => [ + '8.0' => false, + 'alternative' => 'ZipArchive', + ], + 'zip_entry_read' => [ + '8.0' => false, + 'alternative' => 'ZipArchive', + ], + 'zip_open' => [ + '8.0' => false, + 'alternative' => 'ZipArchive::open()', + ], + 'zip_read' => [ + '8.0' => false, + 'alternative' => 'ZipArchive', + ], + + 'date_sunrise' => [ + '8.1' => false, + 'alternative' => 'date_sun_info()', + ], + 'date_sunset' => [ + '8.1' => false, + 'alternative' => 'date_sun_info()', + ], + 'strptime' => [ + '8.1' => false, + 'alternative' => 'date_parse_from_format() or IntlDateFormatter::parse()', + ], + 'strftime' => [ + '8.1' => false, + 'alternative' => 'date() or IntlDateFormatter::format()', + ], + 'gmstrftime' => [ + '8.1' => false, + 'alternative' => 'date() or IntlDateFormatter::format()', + ], + 'mhash_count' => [ + '8.1' => false, + 'alternative' => 'the hash_*() functions', + ], + 'mhash_get_block_size' => [ + '8.1' => false, + 'alternative' => 'the hash_*() functions', + ], + 'mhash_get_hash_name' => [ + '8.1' => false, + 'alternative' => 'the hash_*() functions', + ], + 'mhash_keygen_s2k' => [ + '8.1' => false, + 'alternative' => 'the hash_*() functions', + ], + 'mhash' => [ + '8.1' => false, + 'alternative' => 'the hash_*() functions', + ], + 'odbc_result_all' => [ + '8.1' => false, + ], + 'utf8_encode' => [ + '8.2' => false, + 'alternative' => 'iconv()', + ], + 'utf8_decode' => [ + '8.2' => false, + 'alternative' => 'iconv()', + ], + ]; + + /** + * Returns an array of tokens this test wants to listen for. + * + * @since 5.6 + * + * @return array + */ + public function register() + { + // Handle case-insensitivity of function names. + $this->removedFunctions = \array_change_key_case($this->removedFunctions, \CASE_LOWER); + + return [\T_STRING]; + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @since 5.5 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return void + */ + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $function = $tokens[$stackPtr]['content']; + $functionLc = \strtolower($function); + + if (isset($this->removedFunctions[$functionLc]) === false) { + return; + } + + $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); + if ($nextToken === false + || $tokens[$nextToken]['code'] !== \T_OPEN_PARENTHESIS + || isset($tokens[$nextToken]['parenthesis_owner']) === true + ) { + return; + } + + $ignore = [\T_NEW => true]; + $ignore += Collections::objectOperators(); + + $prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); + if (isset($ignore[$tokens[$prevToken]['code']]) === true) { + // Not a call to a PHP function. + return; + + } elseif ($tokens[$prevToken]['code'] === \T_NS_SEPARATOR) { + $prevPrevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevToken - 1), null, true); + if ($tokens[$prevPrevToken]['code'] === \T_STRING + || $tokens[$prevPrevToken]['code'] === \T_NAMESPACE + ) { + // Namespaced function. + return; + } + } + + $itemInfo = [ + 'name' => $function, + 'nameLc' => $functionLc, + ]; + $this->handleFeature($phpcsFile, $stackPtr, $itemInfo); + } + + /** + * Handle the retrieval of relevant information and if necessary throwing of an error/warning for a matched item. + * + * @since 10.0.0 + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the relevant token in + * the stack. + * @param array $itemInfo Base information about the item. + * + * @return void + */ + protected function handleFeature(File $phpcsFile, $stackPtr, array $itemInfo) + { + $itemArray = $this->removedFunctions[$itemInfo['nameLc']]; + $versionInfo = $this->getVersionInfo($itemArray); + $isError = null; + + if (empty($versionInfo['removed']) === false + && $this->supportsAbove($versionInfo['removed']) === true + ) { + $isError = true; + } elseif (empty($versionInfo['deprecated']) === false + && $this->supportsAbove($versionInfo['deprecated']) === true + ) { + $isError = false; + + // Reset the 'removed' info as it is not relevant for the current notice. + $versionInfo['removed'] = ''; + } + + if (isset($isError) === false) { + return; + } + + // Overrule the default message template. + $this->msgTemplate = 'Function %s() is '; + + $msgInfo = $this->getMessageInfo($itemInfo['name'], $itemInfo['name'], $versionInfo); + + MessageHelper::addMessage( + $phpcsFile, + $msgInfo['message'], + $stackPtr, + $isError, + $msgInfo['errorcode'], + $msgInfo['data'] + ); + } + + /** + * Retrieve version numbers in which a feature was deprecated and/or removed from + * an array with arbitrary contents. + * Will also retrieve a potential "alternative" for the feature from the same array. + * + * The array is expected to have at least one entry with a PHP version number as a key + * and a boolean value. + * + * @param array $itemArray Sub-array for a specific matched item from a complex version array. + * + * @return string[] Array with three keys `'deprecated'`, `'removed'` and `'alternative'`. + * The array values will always be strings and will be either the values retrieved + * from the $itemArray or an empty string if the value for a key was unavailable + * or could not be determined. + */ + protected function getVersionInfo(array $itemArray) + { + $versionInfo = [ + 'deprecated' => '', + 'removed' => '', + 'alternative' => '', + ]; + + foreach ($itemArray as $version => $removed) { + if (isset($itemArray['alternative']) === true) { + $versionInfo['alternative'] = (string) $itemArray['alternative']; + } + + if (\preg_match('`^\d\.\d(\.\d{1,2})?$`', $version) !== 1) { + // Not a version key. + continue; + } + + if ($removed === true && $versionInfo['removed'] === '') { + $versionInfo['removed'] = $version; + } elseif ($removed === false && $versionInfo['deprecated'] === '') { + $versionInfo['deprecated'] = $version; + } + } + + return $versionInfo; + } + + /** + * Convenience method to retrieve the information to be passed to a call to the PHPCS native + * `addError()` or `addWarning()` methods in a simple organized array. + * + * @param string $itemName Item name, normally name of the function or class detected. + * @param string $itemBaseCode The basis for the error code. + * @param string[] $versionInfo Array of version info as received from the getVersionInfo() method. + * + * @return array + */ + protected function getMessageInfo($itemName, $itemBaseCode, array $versionInfo) + { + $message = $this->msgTemplate; + $errorCode = MessageHelper::stringToErrorCode($itemBaseCode, true); + $data = [$itemName]; + + if ($versionInfo['deprecated'] !== '') { + $message .= 'deprecated since PHP %s and '; + $errorCode .= 'Deprecated'; + $data[] = $versionInfo['deprecated']; + } + + if ($versionInfo['removed'] !== '') { + $message .= 'removed since PHP %s and '; + $errorCode .= 'Removed'; + $data[] = $versionInfo['removed']; + } + + // Remove the last 'and' from the message. + $message = \substr($message, 0, (\strlen($message) - 5)); + + if ($versionInfo['alternative'] !== '') { + $message .= $this->alternativeOptionTemplate; + $data[] = $versionInfo['alternative']; + } + + return [ + 'message' => $message, + 'errorcode' => $errorCode, + 'data' => $data, + ]; + } +} diff --git a/Magento2/Tests/PHPCompatibility/RemovedFunctionsUnitTest.inc b/Magento2/Tests/PHPCompatibility/RemovedFunctionsUnitTest.inc new file mode 100644 index 00000000..ebca6c67 --- /dev/null +++ b/Magento2/Tests/PHPCompatibility/RemovedFunctionsUnitTest.inc @@ -0,0 +1,1236 @@ +php_check_syntax(); +MyClass::php_check_syntax(); +MyNamespace\php_check_syntax(); +echo PHP_CHECK_SYNTAX; // Constant. +const php_check_syntax = 'abc'; +use php_check_syntax; +function php_check_syntax() {} +abstract class Split {} + +// More deprecated functions, PHP 7.2 +jpeg2wbmp(); +png2wbmp(); +create_function(); +while (list($key, $val) = each($array)) {} +gmp_random(2); +read_exif_data(); + +// PHP 7.3. +image2wbmp(); +mbregex_encoding(); +mbereg(); +mberegi(); +mbereg_replace(); +mberegi_replace(); +mbsplit(); +mbereg_match(); +mbereg_search(); +mbereg_search_pos(); +mbereg_search_regs(); +mbereg_search_init(); +mbereg_search_getregs(); +mbereg_search_getpos(); +mbereg_search_setpos(); +fgetss(); +gzgetss(); + +// PHP 7.4. +ibase_add_user(); +ibase_affected_rows(); +ibase_backup(); +ibase_blob_add(); +ibase_blob_cancel(); +ibase_blob_close(); +ibase_blob_create(); +ibase_blob_echo(); +ibase_blob_get(); +ibase_blob_import(); +ibase_blob_info(); +ibase_blob_open(); +ibase_close(); +ibase_commit_ret(); +ibase_commit(); +ibase_connect(); +ibase_db_info(); +ibase_delete_user(); +ibase_drop_db(); +ibase_errcode(); +ibase_errmsg(); +ibase_execute(); +ibase_fetch_assoc(); +ibase_fetch_object(); +ibase_fetch_row(); +ibase_field_info(); +ibase_free_event_handler(); +ibase_free_query(); +ibase_free_result(); +ibase_gen_id(); +ibase_maintain_db(); +ibase_modify_user(); +ibase_name_result(); +ibase_num_fields(); +ibase_num_params(); +ibase_param_info(); +ibase_pconnect(); +ibase_prepare(); +ibase_query(); +ibase_restore(); +ibase_rollback_ret(); +ibase_rollback(); +ibase_server_info(); +ibase_service_attach(); +ibase_service_detach(); +ibase_set_event_handler(); +ibase_trans(); +ibase_wait_event(); + +// Pfpro extension - PHP 5.1 +pfpro_cleanup(); +pfpro_init(); +pfpro_process_raw(); +pfpro_process(); +pfpro_version(); + +// PHP 7.4. +wddx_add_vars(); +wddx_deserialize(); +wddx_packet_end(); +wddx_packet_start(); +wddx_serialize_value(); +wddx_serialize_vars(); +ldap_control_paged_result_response(); +ldap_control_paged_result(); +recode_file(); +recode_string(); +recode(); +is_real(); +get_magic_quotes_gpc(); +get_magic_quotes_runtime(); +hebrevc($str)); +convert_cyr_string($str, 'k', 'i'); +money_format(); +ezmlm_hash(); +restore_include_path(); + +// These calls should *not* trigger an error. +$myobject -> php_check_syntax (); // Method, not the native PHP function. +myNamespace \ /*comment*/ php_check_syntax(); // Namespaced function, not the native PHP function. +namespace\php_check_syntax(); // Namespaced function, not the native PHP function. +$obj = new php_check_syntax /*comment*/ (); // Class not method. + +// PHP 5.3 Ncurses extension. +ncurses_addch(); +ncurses_addchnstr(); +ncurses_addchstr(); +ncurses_addnstr(); +ncurses_addstr(); +ncurses_assume_default_colors(); +ncurses_attroff(); +ncurses_attron(); +ncurses_attrset(); +ncurses_baudrate(); +ncurses_beep(); +ncurses_bkgd(); +ncurses_bkgdset(); +ncurses_border(); +ncurses_bottom_panel(); +ncurses_can_change_color(); +ncurses_cbreak(); +ncurses_clear(); +ncurses_clrtobot(); +ncurses_clrtoeol(); +ncurses_color_content(); +ncurses_color_set(); +ncurses_curs_set(); +ncurses_def_prog_mode(); +ncurses_def_shell_mode(); +ncurses_define_key(); +ncurses_del_panel(); +ncurses_delay_output(); +ncurses_delch(); +ncurses_deleteln(); +ncurses_delwin(); +ncurses_doupdate(); +ncurses_echo(); +ncurses_echochar(); +ncurses_end(); +ncurses_erase(); +ncurses_erasechar(); +ncurses_filter(); +ncurses_flash(); +ncurses_flushinp(); +ncurses_getch(); +ncurses_getmaxyx(); +ncurses_getmouse(); +ncurses_getyx(); +ncurses_halfdelay(); +ncurses_has_colors(); +ncurses_has_ic(); +ncurses_has_il(); +ncurses_has_key(); +ncurses_hide_panel(); +ncurses_hline(); +ncurses_inch(); +ncurses_init_color(); +ncurses_init_pair(); +ncurses_init(); +ncurses_insch(); +ncurses_insdelln(); +ncurses_insertln(); +ncurses_insstr(); +ncurses_instr(); +ncurses_isendwin(); +ncurses_keyok(); +ncurses_keypad(); +ncurses_killchar(); +ncurses_longname(); +ncurses_meta(); +ncurses_mouse_trafo(); +ncurses_mouseinterval(); +ncurses_mousemask(); +ncurses_move_panel(); +ncurses_move(); +ncurses_mvaddch(); +ncurses_mvaddchnstr(); +ncurses_mvaddchstr(); +ncurses_mvaddnstr(); +ncurses_mvaddstr(); +ncurses_mvcur(); +ncurses_mvdelch(); +ncurses_mvgetch(); +ncurses_mvhline(); +ncurses_mvinch(); +ncurses_mvvline(); +ncurses_mvwaddstr(); +ncurses_napms(); +ncurses_new_panel(); +ncurses_newpad(); +ncurses_newwin(); +ncurses_nl(); +ncurses_nocbreak(); +ncurses_noecho(); +ncurses_nonl(); +ncurses_noqiflush(); +ncurses_noraw(); +ncurses_pair_content(); +ncurses_panel_above(); +ncurses_panel_below(); +ncurses_panel_window(); +ncurses_pnoutrefresh(); +ncurses_prefresh(); +ncurses_putp(); +ncurses_qiflush(); +ncurses_raw(); +ncurses_refresh(); +ncurses_replace_panel(); +ncurses_reset_prog_mode(); +ncurses_reset_shell_mode(); +ncurses_resetty(); +ncurses_savetty(); +ncurses_scr_dump(); +ncurses_scr_init(); +ncurses_scr_restore(); +ncurses_scr_set(); +ncurses_scrl(); +ncurses_show_panel(); +ncurses_slk_attr(); +ncurses_slk_attroff(); +ncurses_slk_attron(); +ncurses_slk_attrset(); +ncurses_slk_clear(); +ncurses_slk_color(); +ncurses_slk_init(); +ncurses_slk_noutrefresh(); +ncurses_slk_refresh(); +ncurses_slk_restore(); +ncurses_slk_set(); +ncurses_slk_touch(); +ncurses_standend(); +ncurses_standout(); +ncurses_start_color(); +ncurses_termattrs(); +ncurses_termname(); +ncurses_timeout(); +ncurses_top_panel(); +ncurses_typeahead(); +ncurses_ungetch(); +ncurses_ungetmouse(); +ncurses_update_panels(); +ncurses_use_default_colors(); +ncurses_use_env(); +ncurses_use_extended_names(); +ncurses_vidattr(); +ncurses_vline(); +ncurses_waddch(); +ncurses_waddstr(); +ncurses_wattroff(); +ncurses_wattron(); +ncurses_wattrset(); +ncurses_wborder(); +ncurses_wclear(); +ncurses_wcolor_set(); +ncurses_werase(); +ncurses_wgetch(); +ncurses_whline(); +ncurses_wmouse_trafo(); +ncurses_wmove(); +ncurses_wnoutrefresh(); +ncurses_wrefresh(); +ncurses_wstandend(); +ncurses_wstandout(); +ncurses_wvline(); + +// PHP 5.1 MCVE extension. +m_checkstatus(); +m_completeauthorizations(); +m_connect(); +m_connectionerror(); +m_deletetrans(); +m_destroyconn(); +m_destroyengine(); +m_getcell(); +m_getcellbynum(); +m_getcommadelimited(); +m_getheader(); +m_initconn(); +m_initengine(); +m_iscommadelimited(); +m_maxconntimeout(); +m_monitor(); +m_numcolumns(); +m_numrows(); +m_parsecommadelimited(); +m_responsekeys(); +m_responseparam(); +m_returnstatus(); +m_setblocking(); +m_setdropfile(); +m_setip(); +m_setssl_cafile(); +m_setssl_files(); +m_setssl(); +m_settimeout(); +m_sslcert_gen_hash(); +m_transactionssent(); +m_transinqueue(); +m_transkeyval(); +m_transnew(); +m_transsend(); +m_uwait(); +m_validateidentifier(); +m_verifyconnection(); +m_verifysslcert(); + +// PHP 5.1 DIO extension. +dio_close(); +dio_fcntl(); +dio_open(); +dio_read(); +dio_seek(); +dio_stat(); +dio_tcsetattr(); +dio_truncate(); +dio_write(); + +// PHP 5.3 FDF extension. +fdf_add_doc_javascript(); +fdf_add_template(); +fdf_close(); +fdf_create(); +fdf_enum_values(); +fdf_errno(); +fdf_error(); +fdf_get_ap(); +fdf_get_attachment(); +fdf_get_encoding(); +fdf_get_file(); +fdf_get_flags(); +fdf_get_opt(); +fdf_get_status(); +fdf_get_value(); +fdf_get_version(); +fdf_header(); +fdf_next_field_name(); +fdf_open_string(); +fdf_open(); +fdf_remove_item(); +fdf_save_string(); +fdf_save(); +fdf_set_ap(); +fdf_set_encoding(); +fdf_set_file(); +fdf_set_flags(); +fdf_set_javascript_action(); +fdf_set_on_import_javascript(); +fdf_set_opt(); +fdf_set_status(); +fdf_set_submit_form_action(); +fdf_set_target_frame(); +fdf_set_value(); +fdf_set_version(); + +// PHP 5.3 Ming extension. +ming_keypress(); +ming_setcubicthreshold(); +ming_setscale(); +ming_setswfcompression(); +ming_useconstants(); +ming_useswfversion(); + +// PHP 5.1 Fam extension. +fam_cancel_monitor(); +fam_close(); +fam_monitor_collection(); +fam_monitor_directory(); +fam_monitor_file(); +fam_next_event(); +fam_open(); +fam_pending(); +fam_resume_monitor(); +fam_suspend_monitor(); + +// PHP 5.2 HWAPI extension. +hwapi_attribute_new(); +hwapi_content_new(); +hwapi_hgcsp(); +hwapi_object_new(); + +// PHP 5.1 YP/NIS extension. +yp_all(); +yp_cat(); +yp_err_string(); +yp_errno(); +yp_first(); +yp_get_default_domain(); +yp_master(); +yp_match(); +yp_next(); +yp_order(); + +// PHP 5.1 Mnogosearch extension. +udm_add_search_limit(); +udm_alloc_agent_array(); +udm_alloc_agent(); +udm_api_version(); +udm_cat_list(); +udm_cat_path(); +udm_check_charset(); +udm_clear_search_limits(); +udm_crc32(); +udm_errno(); +udm_error(); +udm_find(); +udm_free_agent(); +udm_free_ispell_data(); +udm_free_res(); +udm_get_doc_count(); +udm_get_res_field(); +udm_get_res_param(); +udm_hash32(); +udm_load_ispell_data(); +udm_set_agent_param(); + +// PHP 5.1.3 Msession extension. +msession_connect(); +msession_count(); +msession_create(); +msession_destroy(); +msession_disconnect(); +msession_find(); +msession_get_array(); +msession_get_data(); +msession_get(); +msession_inc(); +msession_list(); +msession_listvar(); +msession_lock(); +msession_plugin(); +msession_randstr(); +msession_set_array(); +msession_set_data(); +msession_set(); +msession_timeout(); +msession_uniq(); +msession_unlock(); + +__autoload($class); + +// PHP 5.0 Crack extension. +crack_check(); +crack_closedict(); +crack_getlastmessage(); +crack_opendict(); + +// PHP 5.1 W32API extension. +w32api_deftype(); +w32api_init_dtype(); +w32api_invoke_function(); +w32api_register_function(); +w32api_set_call_method(); + +// PHP 5.1 CPDF extension. +cpdf_add_annotation(); +cpdf_add_outline(); +cpdf_arc(); +cpdf_begin_text(); +cpdf_circle(); +cpdf_clip(); +cpdf_close(); +cpdf_closepath_fill_stroke(); +cpdf_closepath_stroke(); +cpdf_closepath(); +cpdf_continue_text(); +cpdf_curveto(); +cpdf_end_text(); +cpdf_fill_stroke(); +cpdf_fill(); +cpdf_finalize_page(); +cpdf_finalize(); +cpdf_global_set_document_limits(); +cpdf_import_jpeg(); +cpdf_lineto(); +cpdf_moveto(); +cpdf_newpath(); +cpdf_open(); +cpdf_output_buffer(); +cpdf_page_init(); +cpdf_place_inline_image(); +cpdf_rect(); +cpdf_restore(); +cpdf_rlineto(); +cpdf_rmoveto(); +cpdf_rotate_text(); +cpdf_rotate(); +cpdf_save_to_file(); +cpdf_save(); +cpdf_scale(); +cpdf_set_action_url(); +cpdf_set_char_spacing(); +cpdf_set_creator(); +cpdf_set_current_page(); +cpdf_set_font_directories(); +cpdf_set_font_map_file(); +cpdf_set_font(); +cpdf_set_horiz_scaling(); +cpdf_set_keywords(); +cpdf_set_leading(); +cpdf_set_page_animation(); +cpdf_set_subject(); +cpdf_set_text_matrix(); +cpdf_set_text_pos(); +cpdf_set_text_rendering(); +cpdf_set_text_rise(); +cpdf_set_title(); +cpdf_set_viewer_preferences(); +cpdf_set_word_spacing(); +cpdf_setdash(); +cpdf_setflat(); +cpdf_setgray_fill(); +cpdf_setgray_stroke(); +cpdf_setgray(); +cpdf_setlinecap(); +cpdf_setlinejoin(); +cpdf_setlinewidth(); +cpdf_setmiterlimit(); +cpdf_setrgbcolor_fill(); +cpdf_setrgbcolor_stroke(); +cpdf_setrgbcolor(); +cpdf_show_xy(); +cpdf_show(); +cpdf_stringwidth(); +cpdf_stroke(); +cpdf_text(); +cpdf_translate(); +ircg_channel_mode(); +ircg_disconnect(); +ircg_eval_ecmascript_params(); +ircg_fetch_error_msg(); +ircg_get_username(); +ircg_html_encode(); +ircg_ignore_add(); +ircg_ignore_del(); +ircg_invite(); +ircg_is_conn_alive(); +ircg_join(); +ircg_kick(); +ircg_list(); +ircg_lookup_format_messages(); +ircg_lusers(); +ircg_msg(); +ircg_names(); +ircg_nick(); +ircg_nickname_escape(); +ircg_nickname_unescape(); +ircg_notice(); +ircg_oper(); +ircg_part(); +ircg_pconnect(); +ircg_register_format_messages(); +ircg_set_current(); +ircg_set_file(); +ircg_set_on_die(); +ircg_topic(); +ircg_who(); +ircg_whois(); +dbase_add_record(); +dbase_close(); +dbase_create(); +dbase_delete_record(); +dbase_get_header_info(); +dbase_get_record_with_names(); +dbase_get_record(); +dbase_numfields(); +dbase_numrecords(); +dbase_open(); +dbase_pack(); +dbase_replace_record(); +dbx_close(); +dbx_compare(); +dbx_connect(); +dbx_error(); +dbx_escape_string(); +dbx_fetch_row(); +dbx_query(); +dbx_sort(); +fbsql_affected_rows(); +fbsql_autocommit(); +fbsql_blob_size(); +fbsql_change_user(); +fbsql_clob_size(); +fbsql_close(); +fbsql_commit(); +fbsql_connect(); +fbsql_create_blob(); +fbsql_create_clob(); +fbsql_create_db(); +fbsql_data_seek(); +fbsql_database_password(); +fbsql_database(); +fbsql_db_query(); +fbsql_db_status(); +fbsql_drop_db(); +fbsql_errno(); +fbsql_error(); +fbsql_fetch_array(); +fbsql_fetch_assoc(); +fbsql_fetch_field(); +fbsql_fetch_lengths(); +fbsql_fetch_object(); +fbsql_fetch_row(); +fbsql_field_flags(); +fbsql_field_len(); +fbsql_field_name(); +fbsql_field_seek(); +fbsql_field_table(); +fbsql_field_type(); +fbsql_free_result(); +fbsql_get_autostart_info(); +fbsql_hostname(); +fbsql_insert_id(); +fbsql_list_dbs(); +fbsql_list_fields(); +fbsql_list_tables(); +fbsql_next_result(); +fbsql_num_fields(); +fbsql_num_rows(); +fbsql_password(); +fbsql_pconnect(); +fbsql_query(); +fbsql_read_blob(); +fbsql_read_clob(); +fbsql_result(); +fbsql_rollback(); +fbsql_rows_fetched(); +fbsql_select_db(); +fbsql_set_characterset(); +fbsql_set_lob_mode(); +fbsql_set_password(); +fbsql_set_transaction(); +fbsql_start_db(); +fbsql_stop_db(); +fbsql_table_name(); +fbsql_tablename(); +fbsql_username(); +fbsql_warnings(); +filepro_fieldcount(); +filepro_fieldname(); +filepro_fieldtype(); +filepro_fieldwidth(); +filepro_retrieve(); +filepro_rowcount(); +filepro(); +ingres_autocommit(); +ingres_close(); +ingres_commit(); +ingres_connect(); +ingres_fetch_array(); +ingres_fetch_object(); +ingres_fetch_row(); +ingres_field_length(); +ingres_field_name(); +ingres_field_nullable(); +ingres_field_precision(); +ingres_field_scale(); +ingres_field_type(); +ingres_num_fields(); +ingres_num_rows(); +ingres_pconnect(); +ingres_query(); +ingres_rollback(); +msql_affected_rows(); +msql_close(); +msql_connect(); +msql_create_db(); +msql_createdb(); +msql_data_seek(); +msql_db_query(); +msql_dbname(); +msql_drop_db(); +msql_error(); +msql_fetch_array(); +msql_fetch_field(); +msql_fetch_object(); +msql_fetch_row(); +msql_field_flags(); +msql_field_len(); +msql_field_name(); +msql_field_seek(); +msql_field_table(); +msql_field_type(); +msql_fieldflags(); +msql_fieldlen(); +msql_fieldname(); +msql_fieldtable(); +msql_fieldtype(); +msql_free_result(); +msql_list_dbs(); +msql_list_fields(); +msql_list_tables(); +msql_num_fields(); +msql_num_rows(); +msql_numfields(); +msql_numrows(); +msql_pconnect(); +msql_query(); +msql_regcase(); +msql_result(); +msql_select_db(); +msql_tablename(); +msql(); +mssql_bind(); +mssql_close(); +mssql_connect(); +mssql_data_seek(); +mssql_execute(); +mssql_fetch_array(); +mssql_fetch_assoc(); +mssql_fetch_batch(); +mssql_fetch_field(); +mssql_fetch_object(); +mssql_fetch_row(); +mssql_field_length(); +mssql_field_name(); +mssql_field_seek(); +mssql_field_type(); +mssql_free_result(); +mssql_free_statement(); +mssql_get_last_message(); +mssql_guid_string(); +mssql_init(); +mssql_min_error_severity(); +mssql_min_message_severity(); +mssql_next_result(); +mssql_num_fields(); +mssql_num_rows(); +mssql_pconnect(); +mssql_query(); +mssql_result(); +mssql_rows_affected(); +mssql_select_db(); +sqlite_array_query(); +sqlite_busy_timeout(); +sqlite_changes(); +sqlite_close(); +sqlite_column(); +sqlite_create_aggregate(); +sqlite_create_function(); +sqlite_current(); +sqlite_error_string(); +sqlite_escape_string(); +sqlite_exec(); +sqlite_factory(); +sqlite_fetch_all(); +sqlite_fetch_array(); +sqlite_fetch_column_types(); +sqlite_fetch_object(); +sqlite_fetch_single(); +sqlite_fetch_string(); +sqlite_field_name(); +sqlite_has_more(); +sqlite_has_prev(); +sqlite_key(); +sqlite_last_error(); +sqlite_last_insert_rowid(); +sqlite_libencoding(); +sqlite_libversion(); +sqlite_next(); +sqlite_num_fields(); +sqlite_num_rows(); +sqlite_open(); +sqlite_popen(); +sqlite_prev(); +sqlite_query(); +sqlite_rewind(); +sqlite_seek(); +sqlite_single_query(); +sqlite_udf_decode_binary(); +sqlite_udf_encode_binary(); +sqlite_unbuffered_query(); +sqlite_valid(); +mysql_affected_rows(); +mysql_client_encoding(); +mysql_close(); +mysql_connect(); +mysql_create_db(); +mysql_data_seek(); +mysql_db_name(); +mysql_drop_db(); +mysql_errno(); +mysql_error(); +mysql_fetch_array(); +mysql_fetch_assoc(); +mysql_fetch_field(); +mysql_fetch_lengths(); +mysql_fetch_object(); +mysql_fetch_row(); +mysql_field_flags(); +mysql_field_len(); +mysql_field_name(); +mysql_field_seek(); +mysql_field_table(); +mysql_field_type(); +mysql_free_result(); +mysql_get_client_info(); +mysql_get_host_info(); +mysql_get_proto_info(); +mysql_get_server_info(); +mysql_info(); +mysql_insert_id(); +mysql_list_fields(); +mysql_list_processes(); +mysql_list_tables(); +mysql_num_fields(); +mysql_num_rows(); +mysql_pconnect(); +mysql_ping(); +mysql_query(); +mysql_real_escape_string(); +mysql_result(); +mysql_select_db(); +mysql_set_charset(); +mysql_stat(); +mysql_tablename(); +mysql_thread_id(); +mysql_unbuffered_query(); +mysql(); +mysql_fieldname(); +mysql_fieldtable(); +mysql_fieldlen(); +mysql_fieldtype(); +mysql_fieldflags(); +mysql_selectdb(); +mysql_createdb(); +mysql_dropdb(); +mysql_freeresult(); +mysql_numfields(); +mysql_numrows(); +mysql_listdbs(); +mysql_listtables(); +mysql_listfields(); +mysql_dbname(); +mysql_table_name(); + +// PHP 7.4 ibase extension aliases. +fbird_add_user(); +fbird_affected_rows(); +fbird_backup(); +fbird_blob_add(); +fbird_blob_cancel(); +fbird_blob_close(); +fbird_blob_create(); +fbird_blob_echo(); +fbird_blob_get(); +fbird_blob_import(); +fbird_blob_info(); +fbird_blob_open(); +fbird_close(); +fbird_commit_ret(); +fbird_commit(); +fbird_connect(); +fbird_db_info(); +fbird_delete_user(); +fbird_drop_db(); +fbird_errcode(); +fbird_errmsg(); +fbird_execute(); +fbird_fetch_assoc(); +fbird_fetch_object(); +fbird_fetch_row(); +fbird_field_info(); +fbird_free_event_handler(); +fbird_free_query(); +fbird_free_result(); +fbird_gen_id(); +fbird_maintain_db(); +fbird_modify_user(); +fbird_name_result(); +fbird_num_fields(); +fbird_num_params(); +fbird_param_info(); +fbird_pconnect(); +fbird_prepare(); +fbird_query(); +fbird_restore(); +fbird_rollback_ret(); +fbird_rollback(); +fbird_server_info(); +fbird_service_attach(); +fbird_service_detach(); +fbird_set_event_handler(); +fbird_trans(); +fbird_wait_event(); + +ovrimos_close(); +ovrimos_commit(); +ovrimos_connect(); +ovrimos_cursor(); +ovrimos_exec(); +ovrimos_execute(); +ovrimos_fetch_into(); +ovrimos_fetch_row(); +ovrimos_field_len(); +ovrimos_field_name(); +ovrimos_field_num(); +ovrimos_field_type(); +ovrimos_free_result(); +ovrimos_longreadlen(); +ovrimos_num_fields(); +ovrimos_num_rows(); +ovrimos_prepare(); +ovrimos_result_all(); +ovrimos_result(); +ovrimos_rollback(); +ovrimos_close_all(); + +ora_bind(); +ora_close(); +ora_columnname(); +ora_columnsize(); +ora_columntype(); +ora_commit(); +ora_commitoff(); +ora_commiton(); +ora_do(); +ora_error(); +ora_errorcode(); +ora_exec(); +ora_fetch_into(); +ora_fetch(); +ora_getcolumn(); +ora_logoff(); +ora_logon(); +ora_numcols(); +ora_numrows(); +ora_open(); +ora_parse(); +ora_plogon(); +ora_rollback(); +sybase_affected_rows(); +sybase_close(); +sybase_connect(); +sybase_data_seek(); +sybase_deadlock_retry_count(); +sybase_fetch_array(); +sybase_fetch_assoc(); +sybase_fetch_field(); +sybase_fetch_object(); +sybase_fetch_row(); +sybase_field_seek(); +sybase_free_result(); +sybase_get_last_message(); +sybase_min_client_severity(); +sybase_min_error_severity(); +sybase_min_message_severity(); +sybase_min_server_severity(); +sybase_num_fields(); +sybase_num_rows(); +sybase_pconnect(); +sybase_query(); +sybase_result(); +sybase_select_db(); +sybase_set_message_handler(); +sybase_unbuffered_query(); +ifx_affected_rows(); +ifx_blobinfile_mode(); +ifx_byteasvarchar(); +ifx_close(); +ifx_connect(); +ifx_copy_blob(); +ifx_create_blob(); +ifx_create_char(); +ifx_do(); +ifx_error(); +ifx_errormsg(); +ifx_fetch_row(); +ifx_fieldproperties(); +ifx_fieldtypes(); +ifx_free_blob(); +ifx_free_char(); +ifx_free_result(); +ifx_get_blob(); +ifx_get_char(); +ifx_getsqlca(); +ifx_htmltbl_result(); +ifx_nullformat(); +ifx_num_fields(); +ifx_num_rows(); +ifx_pconnect(); +ifx_prepare(); +ifx_query(); +ifx_textasvarchar(); +ifx_update_blob(); +ifx_update_char(); +ifxus_close_slob(); +ifxus_create_slob(); +ifxus_free_slob(); +ifxus_open_slob(); +ifxus_read_slob(); +ifxus_seek_slob(); +ifxus_tell_slob(); +ifxus_write_slob(); +mysqli_disable_reads_from_master(); +mysqli_disable_rpl_parse(); +mysqli_embedded_connect(); +mysqli_embedded_server_end(); +mysqli_embedded_server_start(); +mysqli_enable_reads_from_master(); +mysqli_enable_rpl_parse(); +mysqli_master_query(); +mysqli_resource(); +mysqli_rpl_parse_enabled(); +mysqli_rpl_probe(); +mysqli_server_end(); +mysqli_server_init(); +mysqli_slave_query(); +xmlrpc_decode_request(); +xmlrpc_decode(); +xmlrpc_encode_request(); +xmlrpc_encode(); +xmlrpc_get_type(); +xmlrpc_is_fault(); +xmlrpc_parse_method_descriptions(); +xmlrpc_server_add_introspection_data(); +xmlrpc_server_call_method(); +xmlrpc_server_create(); +xmlrpc_server_destroy(); +xmlrpc_server_register_introspection_callback(); +xmlrpc_server_register_method(); +xmlrpc_set_type(); +enchant_broker_get_dict_path(); +enchant_broker_set_dict_path(); +enchant_broker_free(); +enchant_broker_free_dict(); +enchant_dict_add_to_personal(); +enchant_dict_is_in_session(); +oci_internal_debug(); +zip_close(); +zip_entry_close(); +zip_entry_compressedsize(); +zip_entry_compressionmethod(); +zip_entry_filesize(); +zip_entry_name(); +zip_entry_open(); +zip_entry_read(); +zip_open(); +zip_read(); +openssl_x509_free(); +openssl_pkey_free(); +libxml_disable_entity_loader(); +pg_clientencoding(); +pg_cmdtuples(); +pg_errormessage(); +pg_fieldname(); +pg_fieldnum(); +pg_fieldisnull(); +pg_fieldprtlen(); +pg_fieldsize(); +pg_fieldtype(); +pg_freeresult(); +pg_getlastoid(); +pg_loclose(); +pg_locreate(); +pg_loexport(); +pg_loimport(); +pg_loopen(); +pg_loread(); +pg_loreadall(); +pg_lounlink(); +pg_lowrite(); +pg_numfields(); +pg_numrows(); +pg_result(); +pg_setclientencoding(); +imap_header(); +shmop_close(); +openssl_free_key(); +date_sunrise(); +date_sunset(); +strptime(); +strftime(); +gmstrftime(); +mhash_count(); +mhash_get_block_size(); +mhash_get_hash_name(); +mhash_keygen_s2k(); +mhash(); +odbc_result_all(); + +// Prevent false positives on PHP 8.0+ nullsafe method calls. +$obj?->php_check_syntax(); // OK. + +//PHP 8.2 deprecations +utf8_encode(); +utf8_decode(); diff --git a/Magento2/Tests/PHPCompatibility/RemovedFunctionsUnitTest.php b/Magento2/Tests/PHPCompatibility/RemovedFunctionsUnitTest.php new file mode 100644 index 00000000..6c409bfa --- /dev/null +++ b/Magento2/Tests/PHPCompatibility/RemovedFunctionsUnitTest.php @@ -0,0 +1,1552 @@ +sniffFile(__FILE__, $okVersion); + foreach ($lines as $line) { + $this->assertNoViolation($file, $line); + } + + $errorVersion = (isset($deprecatedVersion)) ? $deprecatedVersion : $deprecatedIn; + $file = $this->sniffFile(__FILE__, $errorVersion); + $error = "Function {$functionName}() is deprecated since PHP {$deprecatedIn}"; + foreach ($lines as $line) { + $this->assertWarning($file, $line, $error); + } + } + + /** + * Data provider. + * + * @see testDeprecatedFunction() + * + * @return array + */ + public function dataDeprecatedFunction() + { + return [ + ['dl', '5.3', [6], '5.2'], + ['ocifetchinto', '5.4', [63], '5.3'], + ['enchant_broker_get_dict_path', '8.0', [1172], '7.4'], + ['enchant_broker_set_dict_path', '8.0', [1173], '7.4'], + ['libxml_disable_entity_loader', '8.0', [1191], '7.4'], + ['openssl_x509_free', '8.0', [1189], '7.4'], + ['openssl_pkey_free', '8.0', [1190], '7.4'], + ['shmop_close', '8.0', [1217], '7.4'], + ['openssl_free_key', '8.0', [1218], '7.4'], + ['odbc_result_all', '8.1', [1229], '8.0'], + ]; + } + + + /** + * testDeprecatedFunctionWithAlternative + * + * @dataProvider dataDeprecatedFunctionWithAlternative + * + * @param string $functionName Name of the function. + * @param string $deprecatedIn The PHP version in which the function was deprecated. + * @param string $alternative An alternative function. + * @param array $lines The line numbers in the test file which apply to this function. + * @param string $okVersion A PHP version in which the function was still valid. + * @param string $deprecatedVersion Optional PHP version to test deprecation message with - + * if different from the $deprecatedIn version. + * + * @return void + */ + public function testDeprecatedFunctionWithAlternative($functionName, $deprecatedIn, $alternative, $lines, $okVersion, $deprecatedVersion = null) + { + $file = $this->sniffFile(__FILE__, $okVersion); + foreach ($lines as $line) { + $this->assertNoViolation($file, $line); + } + + $errorVersion = (isset($deprecatedVersion)) ? $deprecatedVersion : $deprecatedIn; + $file = $this->sniffFile(__FILE__, $errorVersion); + $error = "Function {$functionName}() is deprecated since PHP {$deprecatedIn}; Use {$alternative} instead"; + foreach ($lines as $line) { + $this->assertWarning($file, $line, $error); + } + } + + /** + * Data provider. + * + * @see testDeprecatedFunctionWithAlternative() + * + * @return array + */ + public function dataDeprecatedFunctionWithAlternative() + { + return [ + ['ocibindbyname', '5.4', 'oci_bind_by_name()', [41], '5.3'], + ['ocicancel', '5.4', 'oci_cancel()', [42], '5.3'], + ['ocicloselob', '5.4', 'OCI-Lob::close() / OCILob::close() (PHP 8+)', [43], '5.3'], + ['ocicollappend', '5.4', 'OCI-Collection::append() / OCICollection::append() (PHP 8+)', [44], '5.3'], + ['ocicollassign', '5.4', 'OCI-Collection::assign() / OCICollection::assign() (PHP 8+)', [45], '5.3'], + ['ocicollassignelem', '5.4', 'OCI-Collection::assignElem() / OCICollection::assignElem() (PHP 8+)', [46], '5.3'], + ['ocicollgetelem', '5.4', 'OCI-Collection::getElem() / OCICollection::getElem() (PHP 8+)', [47], '5.3'], + ['ocicollmax', '5.4', 'OCI-Collection::max() / OCICollection::max() (PHP 8+)', [48], '5.3'], + ['ocicollsize', '5.4', 'OCI-Collection::size() / OCICollection::size() (PHP 8+)', [49], '5.3'], + ['ocicolltrim', '5.4', 'OCI-Collection::trim() / OCICollection::trim() (PHP 8+)', [50], '5.3'], + ['ocicolumnisnull', '5.4', 'oci_field_is_null()', [51], '5.3'], + ['ocicolumnname', '5.4', 'oci_field_name()', [52], '5.3'], + ['ocicolumnprecision', '5.4', 'oci_field_precision()', [53], '5.3'], + ['ocicolumnscale', '5.4', 'oci_field_scale()', [54], '5.3'], + ['ocicolumnsize', '5.4', 'oci_field_size()', [55], '5.3'], + ['ocicolumntype', '5.4', 'oci_field_type()', [56], '5.3'], + ['ocicolumntyperaw', '5.4', 'oci_field_type_raw()', [57], '5.3'], + ['ocicommit', '5.4', 'oci_commit()', [58], '5.3'], + ['ocidefinebyname', '5.4', 'oci_define_by_name()', [59], '5.3'], + ['ocierror', '5.4', 'oci_error()', [60], '5.3'], + ['ociexecute', '5.4', 'oci_execute()', [61], '5.3'], + ['ocifetch', '5.4', 'oci_fetch()', [62], '5.3'], + ['ocifetchstatement', '5.4', 'oci_fetch_all()', [64], '5.3'], + ['ocifreecollection', '5.4', 'OCI-Collection::free() / OCICollection::free() (PHP 8+)', [65], '5.3'], + ['ocifreecursor', '5.4', 'oci_free_statement()', [66], '5.3'], + ['ocifreedesc', '5.4', 'OCI-Lob::free() / OCILob::free() (PHP 8+)', [67], '5.3'], + ['ocifreestatement', '5.4', 'oci_free_statement()', [68], '5.3'], + ['ociloadlob', '5.4', 'OCI-Lob::load() / OCILob::load() (PHP 8+)', [70], '5.3'], + ['ocilogoff', '5.4', 'oci_close()', [71], '5.3'], + ['ocilogon', '5.4', 'oci_connect()', [72], '5.3'], + ['ocinewcollection', '5.4', 'oci_new_collection()', [73], '5.3'], + ['ocinewcursor', '5.4', 'oci_new_cursor()', [74], '5.3'], + ['ocinewdescriptor', '5.4', 'oci_new_descriptor()', [75], '5.3'], + ['ocinlogon', '5.4', 'oci_new_connect()', [76], '5.3'], + ['ocinumcols', '5.4', 'oci_num_fields()', [77], '5.3'], + ['ociparse', '5.4', 'oci_parse()', [78], '5.3'], + ['ociplogon', '5.4', 'oci_pconnect()', [79], '5.3'], + ['ociresult', '5.4', 'oci_result()', [80], '5.3'], + ['ocirollback', '5.4', 'oci_rollback()', [81], '5.3'], + ['ocirowcount', '5.4', 'oci_num_rows()', [82], '5.3'], + ['ocisavelob', '5.4', 'OCI-Lob::save() / OCILob::save() (PHP 8+)', [83], '5.3'], + ['ocisavelobfile', '5.4', 'OCI-Lob::import() / OCILob::import() (PHP 8+)', [84], '5.3'], + ['ociserverversion', '5.4', 'oci_server_version()', [85], '5.3'], + ['ocisetprefetch', '5.4', 'oci_set_prefetch()', [86], '5.3'], + ['ocistatementtype', '5.4', 'oci_statement_type()', [87], '5.3'], + ['ociwritelobtofile', '5.4', 'OCI-Lob::export() / OCILob::export() (PHP 8+)', [88], '5.3'], + ['ociwritetemporarylob', '5.4', 'OCI-Lob::writeTemporary() / OCILob::writeTemporary() (PHP 8+)', [89], '5.3'], + + ['__autoload', '7.2', 'SPL autoload', [589], '7.1'], + ['is_real', '7.4', 'is_float()', [239], '7.3'], + + ['enchant_broker_free', '8.0', 'unset the object', [1174], '7.4'], + ['enchant_broker_free_dict', '8.0', 'unset the object', [1175], '7.4'], + ['enchant_dict_add_to_personal', '8.0', 'enchant_dict_add()', [1176], '7.4'], + ['enchant_dict_is_in_session', '8.0', 'enchant_dict_is_added()', [1177], '7.4'], + ['zip_close', '8.0', 'ZipArchive::close()', [1179], '7.4'], + ['zip_entry_close', '8.0', 'ZipArchive', [1180], '7.4'], + ['zip_entry_compressedsize', '8.0', 'ZipArchive', [1181], '7.4'], + ['zip_entry_compressionmethod', '8.0', 'ZipArchive', [1182], '7.4'], + ['zip_entry_filesize', '8.0', 'ZipArchive', [1183], '7.4'], + ['zip_entry_name', '8.0', 'ZipArchive', [1184], '7.4'], + ['zip_entry_open', '8.0', 'ZipArchive', [1185], '7.4'], + ['zip_entry_read', '8.0', 'ZipArchive', [1186], '7.4'], + ['zip_open', '8.0', 'ZipArchive::open()', [1187], '7.4'], + ['zip_read', '8.0', 'ZipArchive', [1188], '7.4'], + ['pg_clientencoding', '8.0', 'pg_client_encoding()', [1192], '7.4'], + ['pg_cmdtuples', '8.0', 'pg_affected_rows()', [1193], '7.4'], + ['pg_errormessage', '8.0', 'pg_last_error()', [1194], '7.4'], + ['pg_fieldname', '8.0', 'pg_field_name()', [1195], '7.4'], + ['pg_fieldnum', '8.0', 'pg_field_num()', [1196], '7.4'], + ['pg_fieldisnull', '8.0', 'pg_field_is_null()', [1197], '7.4'], + ['pg_fieldprtlen', '8.0', 'pg_field_prtlen()', [1198], '7.4'], + ['pg_fieldsize', '8.0', 'pg_field_size()', [1199], '7.4'], + ['pg_fieldtype', '8.0', 'pg_field_type()', [1200], '7.4'], + ['pg_freeresult', '8.0', 'pg_free_result()', [1201], '7.4'], + ['pg_getlastoid', '8.0', 'pg_last_oid()', [1202], '7.4'], + ['pg_loclose', '8.0', 'pg_lo_close()', [1203], '7.4'], + ['pg_locreate', '8.0', 'pg_lo_create()', [1204], '7.4'], + ['pg_loexport', '8.0', 'pg_lo_export()', [1205], '7.4'], + ['pg_loimport', '8.0', 'pg_lo_import()', [1206], '7.4'], + ['pg_loopen', '8.0', 'pg_lo_open()', [1207], '7.4'], + ['pg_loread', '8.0', 'pg_lo_read()', [1208], '7.4'], + ['pg_loreadall', '8.0', 'pg_lo_read_all()', [1209], '7.4'], + ['pg_lounlink', '8.0', 'pg_lo_unlink()', [1210], '7.4'], + ['pg_lowrite', '8.0', 'pg_lo_write()', [1211], '7.4'], + ['pg_numfields', '8.0', 'pg_num_fields()', [1212], '7.4'], + ['pg_numrows', '8.0', 'pg_num_rows()', [1213], '7.4'], + ['pg_result', '8.0', 'pg_fetch_result()', [1214], '7.4'], + ['pg_setclientencoding', '8.0', 'pg_set_client_encoding()', [1215], '7.4'], + + ['date_sunrise', '8.1', 'date_sun_info()', [1219], '8.0'], + ['date_sunset', '8.1', 'date_sun_info()', [1220], '8.0'], + ['strptime', '8.1', 'date_parse_from_format() or IntlDateFormatter::parse()', [1221], '8.0'], + ['strftime', '8.1', 'date() or IntlDateFormatter::format()', [1222], '8.0'], + ['gmstrftime', '8.1', 'date() or IntlDateFormatter::format()', [1223], '8.0'], + ['mhash_count', '8.1', 'the hash_*() functions', [1224], '8.0'], + ['mhash_get_block_size', '8.1', 'the hash_*() functions', [1225], '8.0'], + ['mhash_get_hash_name', '8.1', 'the hash_*() functions', [1226], '8.0'], + ['mhash_keygen_s2k', '8.1', 'the hash_*() functions', [1227], '8.0'], + ['mhash', '8.1', 'the hash_*() functions', [1228], '8.0'], + ['utf8_encode', '8.2', 'iconv()', [1235], '8.0'], + ['utf8_decode', '8.2', 'iconv()', [1236], '8.0'], + ]; + } + + + /** + * testRemovedFunction + * + * @dataProvider dataRemovedFunction + * + * @param string $functionName Name of the function. + * @param string $removedIn The PHP version in which the function was removed. + * @param array $lines The line numbers in the test file which apply to this function. + * @param string $okVersion A PHP version in which the function was still valid. + * @param string $removedVersion Optional PHP version to test removed message with - + * if different from the $removedIn version. + * + * @return void + */ + public function testRemovedFunction($functionName, $removedIn, $lines, $okVersion, $removedVersion = null) + { + $file = $this->sniffFile(__FILE__, $okVersion); + foreach ($lines as $line) { + $this->assertNoViolation($file, $line); + } + + $errorVersion = (isset($removedVersion)) ? $removedVersion : $removedIn; + $file = $this->sniffFile(__FILE__, $errorVersion); + $error = "Function {$functionName}() is removed since PHP {$removedIn}"; + foreach ($lines as $line) { + $this->assertError($file, $line, $error); + } + } + + /** + * Data provider. + * + * @see testRemovedFunction() + * + * @return array + */ + public function dataRemovedFunction() + { + return [ + ['crack_check', '5.0', [592], '4.4'], + ['crack_closedict', '5.0', [593], '4.4'], + ['crack_getlastmessage', '5.0', [594], '4.4'], + ['crack_opendict', '5.0', [595], '4.4'], + + ['pfpro_cleanup', '5.1', [221], '5.0'], + ['pfpro_init', '5.1', [222], '5.0'], + ['pfpro_process_raw', '5.1', [223], '5.0'], + ['pfpro_process', '5.1', [224], '5.0'], + ['pfpro_version', '5.1', [225], '5.0'], + ['m_checkstatus', '5.1', [417], '5.0'], + ['m_completeauthorizations', '5.1', [418], '5.0'], + ['m_connect', '5.1', [419], '5.0'], + ['m_connectionerror', '5.1', [420], '5.0'], + ['m_deletetrans', '5.1', [421], '5.0'], + ['m_destroyconn', '5.1', [422], '5.0'], + ['m_destroyengine', '5.1', [423], '5.0'], + ['m_getcell', '5.1', [424], '5.0'], + ['m_getcellbynum', '5.1', [425], '5.0'], + ['m_getcommadelimited', '5.1', [426], '5.0'], + ['m_getheader', '5.1', [427], '5.0'], + ['m_initconn', '5.1', [428], '5.0'], + ['m_initengine', '5.1', [429], '5.0'], + ['m_iscommadelimited', '5.1', [430], '5.0'], + ['m_maxconntimeout', '5.1', [431], '5.0'], + ['m_monitor', '5.1', [432], '5.0'], + ['m_numcolumns', '5.1', [433], '5.0'], + ['m_numrows', '5.1', [434], '5.0'], + ['m_parsecommadelimited', '5.1', [435], '5.0'], + ['m_responsekeys', '5.1', [436], '5.0'], + ['m_responseparam', '5.1', [437], '5.0'], + ['m_returnstatus', '5.1', [438], '5.0'], + ['m_setblocking', '5.1', [439], '5.0'], + ['m_setdropfile', '5.1', [440], '5.0'], + ['m_setip', '5.1', [441], '5.0'], + ['m_setssl_cafile', '5.1', [442], '5.0'], + ['m_setssl_files', '5.1', [443], '5.0'], + ['m_setssl', '5.1', [444], '5.0'], + ['m_settimeout', '5.1', [445], '5.0'], + ['m_sslcert_gen_hash', '5.1', [446], '5.0'], + ['m_transactionssent', '5.1', [447], '5.0'], + ['m_transinqueue', '5.1', [448], '5.0'], + ['m_transkeyval', '5.1', [449], '5.0'], + ['m_transnew', '5.1', [450], '5.0'], + ['m_transsend', '5.1', [451], '5.0'], + ['m_uwait', '5.1', [452], '5.0'], + ['m_validateidentifier', '5.1', [453], '5.0'], + ['m_verifyconnection', '5.1', [454], '5.0'], + ['m_verifysslcert', '5.1', [455], '5.0'], + ['dio_close', '5.1', [458], '5.0'], + ['dio_fcntl', '5.1', [459], '5.0'], + ['dio_open', '5.1', [460], '5.0'], + ['dio_read', '5.1', [461], '5.0'], + ['dio_seek', '5.1', [462], '5.0'], + ['dio_stat', '5.1', [463], '5.0'], + ['dio_tcsetattr', '5.1', [464], '5.0'], + ['dio_truncate', '5.1', [465], '5.0'], + ['dio_write', '5.1', [466], '5.0'], + ['fam_cancel_monitor', '5.1', [514], '5.0'], + ['fam_close', '5.1', [515], '5.0'], + ['fam_monitor_collection', '5.1', [516], '5.0'], + ['fam_monitor_directory', '5.1', [517], '5.0'], + ['fam_monitor_file', '5.1', [518], '5.0'], + ['fam_next_event', '5.1', [519], '5.0'], + ['fam_open', '5.1', [520], '5.0'], + ['fam_pending', '5.1', [521], '5.0'], + ['fam_resume_monitor', '5.1', [522], '5.0'], + ['fam_suspend_monitor', '5.1', [523], '5.0'], + ['yp_all', '5.1', [532], '5.0'], + ['yp_cat', '5.1', [533], '5.0'], + ['yp_err_string', '5.1', [534], '5.0'], + ['yp_errno', '5.1', [535], '5.0'], + ['yp_first', '5.1', [536], '5.0'], + ['yp_get_default_domain', '5.1', [537], '5.0'], + ['yp_master', '5.1', [538], '5.0'], + ['yp_match', '5.1', [539], '5.0'], + ['yp_next', '5.1', [540], '5.0'], + ['yp_order', '5.1', [541], '5.0'], + ['udm_add_search_limit', '5.1', [544], '5.0'], + ['udm_alloc_agent_array', '5.1', [545], '5.0'], + ['udm_alloc_agent', '5.1', [546], '5.0'], + ['udm_api_version', '5.1', [547], '5.0'], + ['udm_cat_list', '5.1', [548], '5.0'], + ['udm_cat_path', '5.1', [549], '5.0'], + ['udm_check_charset', '5.1', [550], '5.0'], + ['udm_clear_search_limits', '5.1', [551], '5.0'], + ['udm_crc32', '5.1', [552], '5.0'], + ['udm_errno', '5.1', [553], '5.0'], + ['udm_error', '5.1', [554], '5.0'], + ['udm_find', '5.1', [555], '5.0'], + ['udm_free_agent', '5.1', [556], '5.0'], + ['udm_free_ispell_data', '5.1', [557], '5.0'], + ['udm_free_res', '5.1', [558], '5.0'], + ['udm_get_doc_count', '5.1', [559], '5.0'], + ['udm_get_res_field', '5.1', [560], '5.0'], + ['udm_get_res_param', '5.1', [561], '5.0'], + ['udm_hash32', '5.1', [562], '5.0'], + ['udm_load_ispell_data', '5.1', [563], '5.0'], + ['udm_set_agent_param', '5.1', [564], '5.0'], + ['w32api_deftype', '5.1', [598], '5.0'], + ['w32api_init_dtype', '5.1', [599], '5.0'], + ['w32api_invoke_function', '5.1', [600], '5.0'], + ['w32api_register_function', '5.1', [601], '5.0'], + ['w32api_set_call_method', '5.1', [602], '5.0'], + ['cpdf_add_annotation', '5.1', [605], '5.0'], + ['cpdf_add_outline', '5.1', [606], '5.0'], + ['cpdf_arc', '5.1', [607], '5.0'], + ['cpdf_begin_text', '5.1', [608], '5.0'], + ['cpdf_circle', '5.1', [609], '5.0'], + ['cpdf_clip', '5.1', [610], '5.0'], + ['cpdf_close', '5.1', [611], '5.0'], + ['cpdf_closepath_fill_stroke', '5.1', [612], '5.0'], + ['cpdf_closepath_stroke', '5.1', [613], '5.0'], + ['cpdf_closepath', '5.1', [614], '5.0'], + ['cpdf_continue_text', '5.1', [615], '5.0'], + ['cpdf_curveto', '5.1', [616], '5.0'], + ['cpdf_end_text', '5.1', [617], '5.0'], + ['cpdf_fill_stroke', '5.1', [618], '5.0'], + ['cpdf_fill', '5.1', [619], '5.0'], + ['cpdf_finalize_page', '5.1', [620], '5.0'], + ['cpdf_finalize', '5.1', [621], '5.0'], + ['cpdf_global_set_document_limits', '5.1', [622], '5.0'], + ['cpdf_import_jpeg', '5.1', [623], '5.0'], + ['cpdf_lineto', '5.1', [624], '5.0'], + ['cpdf_moveto', '5.1', [625], '5.0'], + ['cpdf_newpath', '5.1', [626], '5.0'], + ['cpdf_open', '5.1', [627], '5.0'], + ['cpdf_output_buffer', '5.1', [628], '5.0'], + ['cpdf_page_init', '5.1', [629], '5.0'], + ['cpdf_place_inline_image', '5.1', [630], '5.0'], + ['cpdf_rect', '5.1', [631], '5.0'], + ['cpdf_restore', '5.1', [632], '5.0'], + ['cpdf_rlineto', '5.1', [633], '5.0'], + ['cpdf_rmoveto', '5.1', [634], '5.0'], + ['cpdf_rotate_text', '5.1', [635], '5.0'], + ['cpdf_rotate', '5.1', [636], '5.0'], + ['cpdf_save_to_file', '5.1', [637], '5.0'], + ['cpdf_save', '5.1', [638], '5.0'], + ['cpdf_scale', '5.1', [639], '5.0'], + ['cpdf_set_action_url', '5.1', [640], '5.0'], + ['cpdf_set_char_spacing', '5.1', [641], '5.0'], + ['cpdf_set_creator', '5.1', [642], '5.0'], + ['cpdf_set_current_page', '5.1', [643], '5.0'], + ['cpdf_set_font_directories', '5.1', [644], '5.0'], + ['cpdf_set_font_map_file', '5.1', [645], '5.0'], + ['cpdf_set_font', '5.1', [646], '5.0'], + ['cpdf_set_horiz_scaling', '5.1', [647], '5.0'], + ['cpdf_set_keywords', '5.1', [648], '5.0'], + ['cpdf_set_leading', '5.1', [649], '5.0'], + ['cpdf_set_page_animation', '5.1', [650], '5.0'], + ['cpdf_set_subject', '5.1', [651], '5.0'], + ['cpdf_set_text_matrix', '5.1', [652], '5.0'], + ['cpdf_set_text_pos', '5.1', [653], '5.0'], + ['cpdf_set_text_rendering', '5.1', [654], '5.0'], + ['cpdf_set_text_rise', '5.1', [655], '5.0'], + ['cpdf_set_title', '5.1', [656], '5.0'], + ['cpdf_set_viewer_preferences', '5.1', [657], '5.0'], + ['cpdf_set_word_spacing', '5.1', [658], '5.0'], + ['cpdf_setdash', '5.1', [659], '5.0'], + ['cpdf_setflat', '5.1', [660], '5.0'], + ['cpdf_setgray_fill', '5.1', [661], '5.0'], + ['cpdf_setgray_stroke', '5.1', [662], '5.0'], + ['cpdf_setgray', '5.1', [663], '5.0'], + ['cpdf_setlinecap', '5.1', [664], '5.0'], + ['cpdf_setlinejoin', '5.1', [665], '5.0'], + ['cpdf_setlinewidth', '5.1', [666], '5.0'], + ['cpdf_setmiterlimit', '5.1', [667], '5.0'], + ['cpdf_setrgbcolor_fill', '5.1', [668], '5.0'], + ['cpdf_setrgbcolor_stroke', '5.1', [669], '5.0'], + ['cpdf_setrgbcolor', '5.1', [670], '5.0'], + ['cpdf_show_xy', '5.1', [671], '5.0'], + ['cpdf_show', '5.1', [672], '5.0'], + ['cpdf_stringwidth', '5.1', [673], '5.0'], + ['cpdf_stroke', '5.1', [674], '5.0'], + ['cpdf_text', '5.1', [675], '5.0'], + ['cpdf_translate', '5.1', [676], '5.0'], + ['ircg_channel_mode', '5.1', [677], '5.0'], + ['ircg_disconnect', '5.1', [678], '5.0'], + ['ircg_eval_ecmascript_params', '5.1', [679], '5.0'], + ['ircg_fetch_error_msg', '5.1', [680], '5.0'], + ['ircg_get_username', '5.1', [681], '5.0'], + ['ircg_html_encode', '5.1', [682], '5.0'], + ['ircg_ignore_add', '5.1', [683], '5.0'], + ['ircg_ignore_del', '5.1', [684], '5.0'], + ['ircg_invite', '5.1', [685], '5.0'], + ['ircg_is_conn_alive', '5.1', [686], '5.0'], + ['ircg_join', '5.1', [687], '5.0'], + ['ircg_kick', '5.1', [688], '5.0'], + ['ircg_list', '5.1', [689], '5.0'], + ['ircg_lookup_format_messages', '5.1', [690], '5.0'], + ['ircg_lusers', '5.1', [691], '5.0'], + ['ircg_msg', '5.1', [692], '5.0'], + ['ircg_names', '5.1', [693], '5.0'], + ['ircg_nick', '5.1', [694], '5.0'], + ['ircg_nickname_escape', '5.1', [695], '5.0'], + ['ircg_nickname_unescape', '5.1', [696], '5.0'], + ['ircg_notice', '5.1', [697], '5.0'], + ['ircg_oper', '5.1', [698], '5.0'], + ['ircg_part', '5.1', [699], '5.0'], + ['ircg_pconnect', '5.1', [700], '5.0'], + ['ircg_register_format_messages', '5.1', [701], '5.0'], + ['ircg_set_current', '5.1', [702], '5.0'], + ['ircg_set_file', '5.1', [703], '5.0'], + ['ircg_set_on_die', '5.1', [704], '5.0'], + ['ircg_topic', '5.1', [705], '5.0'], + ['ircg_who', '5.1', [706], '5.0'], + ['ircg_whois', '5.1', [707], '5.0'], + ['dbx_close', '5.1', [720], '5.0'], + ['dbx_compare', '5.1', [721], '5.0'], + ['dbx_connect', '5.1', [722], '5.0'], + ['dbx_error', '5.1', [723], '5.0'], + ['dbx_escape_string', '5.1', [724], '5.0'], + ['dbx_fetch_row', '5.1', [725], '5.0'], + ['dbx_query', '5.1', [726], '5.0'], + ['dbx_sort', '5.1', [727], '5.0'], + ['ingres_autocommit', '5.1', [795], '5.0'], + ['ingres_close', '5.1', [796], '5.0'], + ['ingres_commit', '5.1', [797], '5.0'], + ['ingres_connect', '5.1', [798], '5.0'], + ['ingres_fetch_array', '5.1', [799], '5.0'], + ['ingres_fetch_object', '5.1', [800], '5.0'], + ['ingres_fetch_row', '5.1', [801], '5.0'], + ['ingres_field_length', '5.1', [802], '5.0'], + ['ingres_field_name', '5.1', [803], '5.0'], + ['ingres_field_nullable', '5.1', [804], '5.0'], + ['ingres_field_precision', '5.1', [805], '5.0'], + ['ingres_field_scale', '5.1', [806], '5.0'], + ['ingres_field_type', '5.1', [807], '5.0'], + ['ingres_num_fields', '5.1', [808], '5.0'], + ['ingres_num_rows', '5.1', [809], '5.0'], + ['ingres_pconnect', '5.1', [810], '5.0'], + ['ingres_query', '5.1', [811], '5.0'], + ['ingres_rollback', '5.1', [812], '5.0'], + ['ovrimos_close', '5.1', [1036], '5.0'], + ['ovrimos_commit', '5.1', [1037], '5.0'], + ['ovrimos_connect', '5.1', [1038], '5.0'], + ['ovrimos_cursor', '5.1', [1039], '5.0'], + ['ovrimos_exec', '5.1', [1040], '5.0'], + ['ovrimos_execute', '5.1', [1041], '5.0'], + ['ovrimos_fetch_into', '5.1', [1042], '5.0'], + ['ovrimos_fetch_row', '5.1', [1043], '5.0'], + ['ovrimos_field_len', '5.1', [1044], '5.0'], + ['ovrimos_field_name', '5.1', [1045], '5.0'], + ['ovrimos_field_num', '5.1', [1046], '5.0'], + ['ovrimos_field_type', '5.1', [1047], '5.0'], + ['ovrimos_free_result', '5.1', [1048], '5.0'], + ['ovrimos_longreadlen', '5.1', [1049], '5.0'], + ['ovrimos_num_fields', '5.1', [1050], '5.0'], + ['ovrimos_num_rows', '5.1', [1051], '5.0'], + ['ovrimos_prepare', '5.1', [1052], '5.0'], + ['ovrimos_result_all', '5.1', [1053], '5.0'], + ['ovrimos_result', '5.1', [1054], '5.0'], + ['ovrimos_rollback', '5.1', [1055], '5.0'], + ['ovrimos_close_all', '5.1', [1056], '5.0'], + ['ora_bind', '5.1', [1058], '5.0'], + ['ora_close', '5.1', [1059], '5.0'], + ['ora_columnname', '5.1', [1060], '5.0'], + ['ora_columnsize', '5.1', [1061], '5.0'], + ['ora_columntype', '5.1', [1062], '5.0'], + ['ora_commit', '5.1', [1063], '5.0'], + ['ora_commitoff', '5.1', [1064], '5.0'], + ['ora_commiton', '5.1', [1065], '5.0'], + ['ora_do', '5.1', [1066], '5.0'], + ['ora_error', '5.1', [1067], '5.0'], + ['ora_errorcode', '5.1', [1068], '5.0'], + ['ora_exec', '5.1', [1069], '5.0'], + ['ora_fetch_into', '5.1', [1070], '5.0'], + ['ora_fetch', '5.1', [1071], '5.0'], + ['ora_getcolumn', '5.1', [1072], '5.0'], + ['ora_logoff', '5.1', [1073], '5.0'], + ['ora_logon', '5.1', [1074], '5.0'], + ['ora_numcols', '5.1', [1075], '5.0'], + ['ora_numrows', '5.1', [1076], '5.0'], + ['ora_open', '5.1', [1077], '5.0'], + ['ora_parse', '5.1', [1078], '5.0'], + ['ora_plogon', '5.1', [1079], '5.0'], + ['ora_rollback', '5.1', [1080], '5.0'], + ['mysqli_embedded_connect', '5.1', [1146], '5.0'], + ['mysqli_server_end', '5.1', [1155], '5.0'], + ['mysqli_server_init', '5.1', [1156], '5.0'], + + ['msession_connect', '5.1.3', [567], '5.1', '5.2'], + ['msession_count', '5.1.3', [568], '5.1', '5.2'], + ['msession_create', '5.1.3', [569], '5.1', '5.2'], + ['msession_destroy', '5.1.3', [570], '5.1', '5.2'], + ['msession_disconnect', '5.1.3', [571], '5.1', '5.2'], + ['msession_find', '5.1.3', [572], '5.1', '5.2'], + ['msession_get_array', '5.1.3', [573], '5.1', '5.2'], + ['msession_get_data', '5.1.3', [574], '5.1', '5.2'], + ['msession_get', '5.1.3', [575], '5.1', '5.2'], + ['msession_inc', '5.1.3', [576], '5.1', '5.2'], + ['msession_list', '5.1.3', [577], '5.1', '5.2'], + ['msession_listvar', '5.1.3', [578], '5.1', '5.2'], + ['msession_lock', '5.1.3', [579], '5.1', '5.2'], + ['msession_plugin', '5.1.3', [580], '5.1', '5.2'], + ['msession_randstr', '5.1.3', [581], '5.1', '5.2'], + ['msession_set_array', '5.1.3', [582], '5.1', '5.2'], + ['msession_set_data', '5.1.3', [583], '5.1', '5.2'], + ['msession_set', '5.1.3', [584], '5.1', '5.2'], + ['msession_timeout', '5.1.3', [585], '5.1', '5.2'], + ['msession_uniq', '5.1.3', [586], '5.1', '5.2'], + ['msession_unlock', '5.1.3', [587], '5.1', '5.2'], + + ['mysqli_resource', '5.1.4', [1152], '5.1', '5.2'], + + ['mysql_createdb', '5.1.7', [975], '5.1', '5.2'], + ['mysql_dropdb', '5.1.7', [976], '5.1', '5.2'], + ['mysql_listtables', '5.1.7', [981], '5.1', '5.2'], + + ['hwapi_attribute_new', '5.2', [526], '5.1'], + ['hwapi_content_new', '5.2', [527], '5.1'], + ['hwapi_hgcsp', '5.2', [528], '5.1'], + ['hwapi_object_new', '5.2', [529], '5.1'], + ['filepro_fieldcount', '5.2', [788], '5.1'], + ['filepro_fieldname', '5.2', [789], '5.1'], + ['filepro_fieldtype', '5.2', [790], '5.1'], + ['filepro_fieldwidth', '5.2', [791], '5.1'], + ['filepro_retrieve', '5.2', [792], '5.1'], + ['filepro_rowcount', '5.2', [793], '5.1'], + ['filepro', '5.2', [794], '5.1'], + + ['ifx_affected_rows', '5.2.1', [1106], '5.2', '5.3'], + ['ifx_blobinfile_mode', '5.2.1', [1107], '5.2', '5.3'], + ['ifx_byteasvarchar', '5.2.1', [1108], '5.2', '5.3'], + ['ifx_close', '5.2.1', [1109], '5.2', '5.3'], + ['ifx_connect', '5.2.1', [1110], '5.2', '5.3'], + ['ifx_copy_blob', '5.2.1', [1111], '5.2', '5.3'], + ['ifx_create_blob', '5.2.1', [1112], '5.2', '5.3'], + ['ifx_create_char', '5.2.1', [1113], '5.2', '5.3'], + ['ifx_do', '5.2.1', [1114], '5.2', '5.3'], + ['ifx_error', '5.2.1', [1115], '5.2', '5.3'], + ['ifx_errormsg', '5.2.1', [1116], '5.2', '5.3'], + ['ifx_fetch_row', '5.2.1', [1117], '5.2', '5.3'], + ['ifx_fieldproperties', '5.2.1', [1118], '5.2', '5.3'], + ['ifx_fieldtypes', '5.2.1', [1119], '5.2', '5.3'], + ['ifx_free_blob', '5.2.1', [1120], '5.2', '5.3'], + ['ifx_free_char', '5.2.1', [1121], '5.2', '5.3'], + ['ifx_free_result', '5.2.1', [1122], '5.2', '5.3'], + ['ifx_get_blob', '5.2.1', [1123], '5.2', '5.3'], + ['ifx_get_char', '5.2.1', [1124], '5.2', '5.3'], + ['ifx_getsqlca', '5.2.1', [1125], '5.2', '5.3'], + ['ifx_htmltbl_result', '5.2.1', [1126], '5.2', '5.3'], + ['ifx_nullformat', '5.2.1', [1127], '5.2', '5.3'], + ['ifx_num_fields', '5.2.1', [1128], '5.2', '5.3'], + ['ifx_num_rows', '5.2.1', [1129], '5.2', '5.3'], + ['ifx_pconnect', '5.2.1', [1130], '5.2', '5.3'], + ['ifx_prepare', '5.2.1', [1131], '5.2', '5.3'], + ['ifx_query', '5.2.1', [1132], '5.2', '5.3'], + ['ifx_textasvarchar', '5.2.1', [1133], '5.2', '5.3'], + ['ifx_update_blob', '5.2.1', [1134], '5.2', '5.3'], + ['ifx_update_char', '5.2.1', [1135], '5.2', '5.3'], + ['ifxus_close_slob', '5.2.1', [1136], '5.2', '5.3'], + ['ifxus_create_slob', '5.2.1', [1137], '5.2', '5.3'], + ['ifxus_free_slob', '5.2.1', [1138], '5.2', '5.3'], + ['ifxus_open_slob', '5.2.1', [1139], '5.2', '5.3'], + ['ifxus_read_slob', '5.2.1', [1140], '5.2', '5.3'], + ['ifxus_seek_slob', '5.2.1', [1141], '5.2', '5.3'], + ['ifxus_tell_slob', '5.2.1', [1142], '5.2', '5.3'], + ['ifxus_write_slob', '5.2.1', [1143], '5.2', '5.3'], + + ['ncurses_addch', '5.3', [255], '5.2'], + ['ncurses_addchnstr', '5.3', [256], '5.2'], + ['ncurses_addchstr', '5.3', [257], '5.2'], + ['ncurses_addnstr', '5.3', [258], '5.2'], + ['ncurses_addstr', '5.3', [259], '5.2'], + ['ncurses_assume_default_colors', '5.3', [260], '5.2'], + ['ncurses_attroff', '5.3', [261], '5.2'], + ['ncurses_attron', '5.3', [262], '5.2'], + ['ncurses_attrset', '5.3', [263], '5.2'], + ['ncurses_baudrate', '5.3', [264], '5.2'], + ['ncurses_beep', '5.3', [265], '5.2'], + ['ncurses_bkgd', '5.3', [266], '5.2'], + ['ncurses_bkgdset', '5.3', [267], '5.2'], + ['ncurses_border', '5.3', [268], '5.2'], + ['ncurses_bottom_panel', '5.3', [269], '5.2'], + ['ncurses_can_change_color', '5.3', [270], '5.2'], + ['ncurses_cbreak', '5.3', [271], '5.2'], + ['ncurses_clear', '5.3', [272], '5.2'], + ['ncurses_clrtobot', '5.3', [273], '5.2'], + ['ncurses_clrtoeol', '5.3', [274], '5.2'], + ['ncurses_color_content', '5.3', [275], '5.2'], + ['ncurses_color_set', '5.3', [276], '5.2'], + ['ncurses_curs_set', '5.3', [277], '5.2'], + ['ncurses_def_prog_mode', '5.3', [278], '5.2'], + ['ncurses_def_shell_mode', '5.3', [279], '5.2'], + ['ncurses_define_key', '5.3', [280], '5.2'], + ['ncurses_del_panel', '5.3', [281], '5.2'], + ['ncurses_delay_output', '5.3', [282], '5.2'], + ['ncurses_delch', '5.3', [283], '5.2'], + ['ncurses_deleteln', '5.3', [284], '5.2'], + ['ncurses_delwin', '5.3', [285], '5.2'], + ['ncurses_doupdate', '5.3', [286], '5.2'], + ['ncurses_echo', '5.3', [287], '5.2'], + ['ncurses_echochar', '5.3', [288], '5.2'], + ['ncurses_end', '5.3', [289], '5.2'], + ['ncurses_erase', '5.3', [290], '5.2'], + ['ncurses_erasechar', '5.3', [291], '5.2'], + ['ncurses_filter', '5.3', [292], '5.2'], + ['ncurses_flash', '5.3', [293], '5.2'], + ['ncurses_flushinp', '5.3', [294], '5.2'], + ['ncurses_getch', '5.3', [295], '5.2'], + ['ncurses_getmaxyx', '5.3', [296], '5.2'], + ['ncurses_getmouse', '5.3', [297], '5.2'], + ['ncurses_getyx', '5.3', [298], '5.2'], + ['ncurses_halfdelay', '5.3', [299], '5.2'], + ['ncurses_has_colors', '5.3', [300], '5.2'], + ['ncurses_has_ic', '5.3', [301], '5.2'], + ['ncurses_has_il', '5.3', [302], '5.2'], + ['ncurses_has_key', '5.3', [303], '5.2'], + ['ncurses_hide_panel', '5.3', [304], '5.2'], + ['ncurses_hline', '5.3', [305], '5.2'], + ['ncurses_inch', '5.3', [306], '5.2'], + ['ncurses_init_color', '5.3', [307], '5.2'], + ['ncurses_init_pair', '5.3', [308], '5.2'], + ['ncurses_init', '5.3', [309], '5.2'], + ['ncurses_insch', '5.3', [310], '5.2'], + ['ncurses_insdelln', '5.3', [311], '5.2'], + ['ncurses_insertln', '5.3', [312], '5.2'], + ['ncurses_insstr', '5.3', [313], '5.2'], + ['ncurses_instr', '5.3', [314], '5.2'], + ['ncurses_isendwin', '5.3', [315], '5.2'], + ['ncurses_keyok', '5.3', [316], '5.2'], + ['ncurses_keypad', '5.3', [317], '5.2'], + ['ncurses_killchar', '5.3', [318], '5.2'], + ['ncurses_longname', '5.3', [319], '5.2'], + ['ncurses_meta', '5.3', [320], '5.2'], + ['ncurses_mouse_trafo', '5.3', [321], '5.2'], + ['ncurses_mouseinterval', '5.3', [322], '5.2'], + ['ncurses_mousemask', '5.3', [323], '5.2'], + ['ncurses_move_panel', '5.3', [324], '5.2'], + ['ncurses_move', '5.3', [325], '5.2'], + ['ncurses_mvaddch', '5.3', [326], '5.2'], + ['ncurses_mvaddchnstr', '5.3', [327], '5.2'], + ['ncurses_mvaddchstr', '5.3', [328], '5.2'], + ['ncurses_mvaddnstr', '5.3', [329], '5.2'], + ['ncurses_mvaddstr', '5.3', [330], '5.2'], + ['ncurses_mvcur', '5.3', [331], '5.2'], + ['ncurses_mvdelch', '5.3', [332], '5.2'], + ['ncurses_mvgetch', '5.3', [333], '5.2'], + ['ncurses_mvhline', '5.3', [334], '5.2'], + ['ncurses_mvinch', '5.3', [335], '5.2'], + ['ncurses_mvvline', '5.3', [336], '5.2'], + ['ncurses_mvwaddstr', '5.3', [337], '5.2'], + ['ncurses_napms', '5.3', [338], '5.2'], + ['ncurses_new_panel', '5.3', [339], '5.2'], + ['ncurses_newpad', '5.3', [340], '5.2'], + ['ncurses_newwin', '5.3', [341], '5.2'], + ['ncurses_nl', '5.3', [342], '5.2'], + ['ncurses_nocbreak', '5.3', [343], '5.2'], + ['ncurses_noecho', '5.3', [344], '5.2'], + ['ncurses_nonl', '5.3', [345], '5.2'], + ['ncurses_noqiflush', '5.3', [346], '5.2'], + ['ncurses_noraw', '5.3', [347], '5.2'], + ['ncurses_pair_content', '5.3', [348], '5.2'], + ['ncurses_panel_above', '5.3', [349], '5.2'], + ['ncurses_panel_below', '5.3', [350], '5.2'], + ['ncurses_panel_window', '5.3', [351], '5.2'], + ['ncurses_pnoutrefresh', '5.3', [352], '5.2'], + ['ncurses_prefresh', '5.3', [353], '5.2'], + ['ncurses_putp', '5.3', [354], '5.2'], + ['ncurses_qiflush', '5.3', [355], '5.2'], + ['ncurses_raw', '5.3', [356], '5.2'], + ['ncurses_refresh', '5.3', [357], '5.2'], + ['ncurses_replace_panel', '5.3', [358], '5.2'], + ['ncurses_reset_prog_mode', '5.3', [359], '5.2'], + ['ncurses_reset_shell_mode', '5.3', [360], '5.2'], + ['ncurses_resetty', '5.3', [361], '5.2'], + ['ncurses_savetty', '5.3', [362], '5.2'], + ['ncurses_scr_dump', '5.3', [363], '5.2'], + ['ncurses_scr_init', '5.3', [364], '5.2'], + ['ncurses_scr_restore', '5.3', [365], '5.2'], + ['ncurses_scr_set', '5.3', [366], '5.2'], + ['ncurses_scrl', '5.3', [367], '5.2'], + ['ncurses_show_panel', '5.3', [368], '5.2'], + ['ncurses_slk_attr', '5.3', [369], '5.2'], + ['ncurses_slk_attroff', '5.3', [370], '5.2'], + ['ncurses_slk_attron', '5.3', [371], '5.2'], + ['ncurses_slk_attrset', '5.3', [372], '5.2'], + ['ncurses_slk_clear', '5.3', [373], '5.2'], + ['ncurses_slk_color', '5.3', [374], '5.2'], + ['ncurses_slk_init', '5.3', [375], '5.2'], + ['ncurses_slk_noutrefresh', '5.3', [376], '5.2'], + ['ncurses_slk_refresh', '5.3', [377], '5.2'], + ['ncurses_slk_restore', '5.3', [378], '5.2'], + ['ncurses_slk_set', '5.3', [379], '5.2'], + ['ncurses_slk_touch', '5.3', [380], '5.2'], + ['ncurses_standend', '5.3', [381], '5.2'], + ['ncurses_standout', '5.3', [382], '5.2'], + ['ncurses_start_color', '5.3', [383], '5.2'], + ['ncurses_termattrs', '5.3', [384], '5.2'], + ['ncurses_termname', '5.3', [385], '5.2'], + ['ncurses_timeout', '5.3', [386], '5.2'], + ['ncurses_top_panel', '5.3', [387], '5.2'], + ['ncurses_typeahead', '5.3', [388], '5.2'], + ['ncurses_ungetch', '5.3', [389], '5.2'], + ['ncurses_ungetmouse', '5.3', [390], '5.2'], + ['ncurses_update_panels', '5.3', [391], '5.2'], + ['ncurses_use_default_colors', '5.3', [392], '5.2'], + ['ncurses_use_env', '5.3', [393], '5.2'], + ['ncurses_use_extended_names', '5.3', [394], '5.2'], + ['ncurses_vidattr', '5.3', [395], '5.2'], + ['ncurses_vline', '5.3', [396], '5.2'], + ['ncurses_waddch', '5.3', [397], '5.2'], + ['ncurses_waddstr', '5.3', [398], '5.2'], + ['ncurses_wattroff', '5.3', [399], '5.2'], + ['ncurses_wattron', '5.3', [400], '5.2'], + ['ncurses_wattrset', '5.3', [401], '5.2'], + ['ncurses_wborder', '5.3', [402], '5.2'], + ['ncurses_wclear', '5.3', [403], '5.2'], + ['ncurses_wcolor_set', '5.3', [404], '5.2'], + ['ncurses_werase', '5.3', [405], '5.2'], + ['ncurses_wgetch', '5.3', [406], '5.2'], + ['ncurses_whline', '5.3', [407], '5.2'], + ['ncurses_wmouse_trafo', '5.3', [408], '5.2'], + ['ncurses_wmove', '5.3', [409], '5.2'], + ['ncurses_wnoutrefresh', '5.3', [410], '5.2'], + ['ncurses_wrefresh', '5.3', [411], '5.2'], + ['ncurses_wstandend', '5.3', [412], '5.2'], + ['ncurses_wstandout', '5.3', [413], '5.2'], + ['ncurses_wvline', '5.3', [414], '5.2'], + ['fdf_add_doc_javascript', '5.3', [469], '5.2'], + ['fdf_add_template', '5.3', [470], '5.2'], + ['fdf_close', '5.3', [471], '5.2'], + ['fdf_create', '5.3', [472], '5.2'], + ['fdf_enum_values', '5.3', [473], '5.2'], + ['fdf_errno', '5.3', [474], '5.2'], + ['fdf_error', '5.3', [475], '5.2'], + ['fdf_get_ap', '5.3', [476], '5.2'], + ['fdf_get_attachment', '5.3', [477], '5.2'], + ['fdf_get_encoding', '5.3', [478], '5.2'], + ['fdf_get_file', '5.3', [479], '5.2'], + ['fdf_get_flags', '5.3', [480], '5.2'], + ['fdf_get_opt', '5.3', [481], '5.2'], + ['fdf_get_status', '5.3', [482], '5.2'], + ['fdf_get_value', '5.3', [483], '5.2'], + ['fdf_get_version', '5.3', [484], '5.2'], + ['fdf_header', '5.3', [485], '5.2'], + ['fdf_next_field_name', '5.3', [486], '5.2'], + ['fdf_open_string', '5.3', [487], '5.2'], + ['fdf_open', '5.3', [488], '5.2'], + ['fdf_remove_item', '5.3', [489], '5.2'], + ['fdf_save_string', '5.3', [490], '5.2'], + ['fdf_save', '5.3', [491], '5.2'], + ['fdf_set_ap', '5.3', [492], '5.2'], + ['fdf_set_encoding', '5.3', [493], '5.2'], + ['fdf_set_file', '5.3', [494], '5.2'], + ['fdf_set_flags', '5.3', [495], '5.2'], + ['fdf_set_javascript_action', '5.3', [496], '5.2'], + ['fdf_set_on_import_javascript', '5.3', [497], '5.2'], + ['fdf_set_opt', '5.3', [498], '5.2'], + ['fdf_set_status', '5.3', [499], '5.2'], + ['fdf_set_submit_form_action', '5.3', [500], '5.2'], + ['fdf_set_target_frame', '5.3', [501], '5.2'], + ['fdf_set_value', '5.3', [502], '5.2'], + ['fdf_set_version', '5.3', [503], '5.2'], + ['ming_keypress', '5.3', [506], '5.2'], + ['ming_setcubicthreshold', '5.3', [507], '5.2'], + ['ming_setscale', '5.3', [508], '5.2'], + ['ming_setswfcompression', '5.3', [509], '5.2'], + ['ming_useconstants', '5.3', [510], '5.2'], + ['ming_useswfversion', '5.3', [511], '5.2'], + ['dbase_add_record', '5.3', [708], '5.2'], + ['dbase_close', '5.3', [709], '5.2'], + ['dbase_create', '5.3', [710], '5.2'], + ['dbase_delete_record', '5.3', [711], '5.2'], + ['dbase_get_header_info', '5.3', [712], '5.2'], + ['dbase_get_record_with_names', '5.3', [713], '5.2'], + ['dbase_get_record', '5.3', [714], '5.2'], + ['dbase_numfields', '5.3', [715], '5.2'], + ['dbase_numrecords', '5.3', [716], '5.2'], + ['dbase_open', '5.3', [717], '5.2'], + ['dbase_pack', '5.3', [718], '5.2'], + ['dbase_replace_record', '5.3', [719], '5.2'], + ['fbsql_affected_rows', '5.3', [728], '5.2'], + ['fbsql_autocommit', '5.3', [729], '5.2'], + ['fbsql_blob_size', '5.3', [730], '5.2'], + ['fbsql_change_user', '5.3', [731], '5.2'], + ['fbsql_clob_size', '5.3', [732], '5.2'], + ['fbsql_close', '5.3', [733], '5.2'], + ['fbsql_commit', '5.3', [734], '5.2'], + ['fbsql_connect', '5.3', [735], '5.2'], + ['fbsql_create_blob', '5.3', [736], '5.2'], + ['fbsql_create_clob', '5.3', [737], '5.2'], + ['fbsql_create_db', '5.3', [738], '5.2'], + ['fbsql_data_seek', '5.3', [739], '5.2'], + ['fbsql_database_password', '5.3', [740], '5.2'], + ['fbsql_database', '5.3', [741], '5.2'], + ['fbsql_db_query', '5.3', [742], '5.2'], + ['fbsql_db_status', '5.3', [743], '5.2'], + ['fbsql_drop_db', '5.3', [744], '5.2'], + ['fbsql_errno', '5.3', [745], '5.2'], + ['fbsql_error', '5.3', [746], '5.2'], + ['fbsql_fetch_array', '5.3', [747], '5.2'], + ['fbsql_fetch_assoc', '5.3', [748], '5.2'], + ['fbsql_fetch_field', '5.3', [749], '5.2'], + ['fbsql_fetch_lengths', '5.3', [750], '5.2'], + ['fbsql_fetch_object', '5.3', [751], '5.2'], + ['fbsql_fetch_row', '5.3', [752], '5.2'], + ['fbsql_field_flags', '5.3', [753], '5.2'], + ['fbsql_field_len', '5.3', [754], '5.2'], + ['fbsql_field_name', '5.3', [755], '5.2'], + ['fbsql_field_seek', '5.3', [756], '5.2'], + ['fbsql_field_table', '5.3', [757], '5.2'], + ['fbsql_field_type', '5.3', [758], '5.2'], + ['fbsql_free_result', '5.3', [759], '5.2'], + ['fbsql_get_autostart_info', '5.3', [760], '5.2'], + ['fbsql_hostname', '5.3', [761], '5.2'], + ['fbsql_insert_id', '5.3', [762], '5.2'], + ['fbsql_list_dbs', '5.3', [763], '5.2'], + ['fbsql_list_fields', '5.3', [764], '5.2'], + ['fbsql_list_tables', '5.3', [765], '5.2'], + ['fbsql_next_result', '5.3', [766], '5.2'], + ['fbsql_num_fields', '5.3', [767], '5.2'], + ['fbsql_num_rows', '5.3', [768], '5.2'], + ['fbsql_password', '5.3', [769], '5.2'], + ['fbsql_pconnect', '5.3', [770], '5.2'], + ['fbsql_query', '5.3', [771], '5.2'], + ['fbsql_read_blob', '5.3', [772], '5.2'], + ['fbsql_read_clob', '5.3', [773], '5.2'], + ['fbsql_result', '5.3', [774], '5.2'], + ['fbsql_rollback', '5.3', [775], '5.2'], + ['fbsql_rows_fetched', '5.3', [776], '5.2'], + ['fbsql_select_db', '5.3', [777], '5.2'], + ['fbsql_set_characterset', '5.3', [778], '5.2'], + ['fbsql_set_lob_mode', '5.3', [779], '5.2'], + ['fbsql_set_password', '5.3', [780], '5.2'], + ['fbsql_set_transaction', '5.3', [781], '5.2'], + ['fbsql_start_db', '5.3', [782], '5.2'], + ['fbsql_stop_db', '5.3', [783], '5.2'], + ['fbsql_table_name', '5.3', [784], '5.2'], + ['fbsql_tablename', '5.3', [785], '5.2'], + ['fbsql_username', '5.3', [786], '5.2'], + ['fbsql_warnings', '5.3', [787], '5.2'], + ['msql_affected_rows', '5.3', [813], '5.2'], + ['msql_close', '5.3', [814], '5.2'], + ['msql_connect', '5.3', [815], '5.2'], + ['msql_create_db', '5.3', [816], '5.2'], + ['msql_createdb', '5.3', [817], '5.2'], + ['msql_data_seek', '5.3', [818], '5.2'], + ['msql_db_query', '5.3', [819], '5.2'], + ['msql_dbname', '5.3', [820], '5.2'], + ['msql_drop_db', '5.3', [821], '5.2'], + ['msql_error', '5.3', [822], '5.2'], + ['msql_fetch_array', '5.3', [823], '5.2'], + ['msql_fetch_field', '5.3', [824], '5.2'], + ['msql_fetch_object', '5.3', [825], '5.2'], + ['msql_fetch_row', '5.3', [826], '5.2'], + ['msql_field_flags', '5.3', [827], '5.2'], + ['msql_field_len', '5.3', [828], '5.2'], + ['msql_field_name', '5.3', [829], '5.2'], + ['msql_field_seek', '5.3', [830], '5.2'], + ['msql_field_table', '5.3', [831], '5.2'], + ['msql_field_type', '5.3', [832], '5.2'], + ['msql_fieldflags', '5.3', [833], '5.2'], + ['msql_fieldlen', '5.3', [834], '5.2'], + ['msql_fieldname', '5.3', [835], '5.2'], + ['msql_fieldtable', '5.3', [836], '5.2'], + ['msql_fieldtype', '5.3', [837], '5.2'], + ['msql_free_result', '5.3', [838], '5.2'], + ['msql_list_dbs', '5.3', [839], '5.2'], + ['msql_list_fields', '5.3', [840], '5.2'], + ['msql_list_tables', '5.3', [841], '5.2'], + ['msql_num_fields', '5.3', [842], '5.2'], + ['msql_num_rows', '5.3', [843], '5.2'], + ['msql_numfields', '5.3', [844], '5.2'], + ['msql_numrows', '5.3', [845], '5.2'], + ['msql_pconnect', '5.3', [846], '5.2'], + ['msql_query', '5.3', [847], '5.2'], + ['msql_regcase', '5.3', [848], '5.2'], + ['msql_result', '5.3', [849], '5.2'], + ['msql_select_db', '5.3', [850], '5.2'], + ['msql_tablename', '5.3', [851], '5.2'], + ['msql', '5.3', [852], '5.2'], + ['mysqli_disable_reads_from_master', '5.3', [1144], '5.2'], + ['mysqli_disable_rpl_parse', '5.3', [1145], '5.2'], + ['mysqli_enable_reads_from_master', '5.3', [1149], '5.2'], + ['mysqli_enable_rpl_parse', '5.3', [1150], '5.2'], + ['mysqli_master_query', '5.3', [1151], '5.2'], + ['mysqli_rpl_parse_enabled', '5.3', [1153], '5.2'], + ['mysqli_rpl_probe', '5.3', [1154], '5.2'], + ['mysqli_slave_query', '5.3', [1157], '5.2'], + + ['sqlite_array_query', '5.4', [883], '5.3'], + ['sqlite_busy_timeout', '5.4', [884], '5.3'], + ['sqlite_changes', '5.4', [885], '5.3'], + ['sqlite_close', '5.4', [886], '5.3'], + ['sqlite_column', '5.4', [887], '5.3'], + ['sqlite_create_aggregate', '5.4', [888], '5.3'], + ['sqlite_create_function', '5.4', [889], '5.3'], + ['sqlite_current', '5.4', [890], '5.3'], + ['sqlite_error_string', '5.4', [891], '5.3'], + ['sqlite_escape_string', '5.4', [892], '5.3'], + ['sqlite_exec', '5.4', [893], '5.3'], + ['sqlite_factory', '5.4', [894], '5.3'], + ['sqlite_fetch_all', '5.4', [895], '5.3'], + ['sqlite_fetch_array', '5.4', [896], '5.3'], + ['sqlite_fetch_column_types', '5.4', [897], '5.3'], + ['sqlite_fetch_object', '5.4', [898], '5.3'], + ['sqlite_fetch_single', '5.4', [899], '5.3'], + ['sqlite_fetch_string', '5.4', [900], '5.3'], + ['sqlite_field_name', '5.4', [901], '5.3'], + ['sqlite_has_more', '5.4', [902], '5.3'], + ['sqlite_has_prev', '5.4', [903], '5.3'], + ['sqlite_key', '5.4', [904], '5.3'], + ['sqlite_last_error', '5.4', [905], '5.3'], + ['sqlite_last_insert_rowid', '5.4', [906], '5.3'], + ['sqlite_libencoding', '5.4', [907], '5.3'], + ['sqlite_libversion', '5.4', [908], '5.3'], + ['sqlite_next', '5.4', [909], '5.3'], + ['sqlite_num_fields', '5.4', [910], '5.3'], + ['sqlite_num_rows', '5.4', [911], '5.3'], + ['sqlite_open', '5.4', [912], '5.3'], + ['sqlite_popen', '5.4', [913], '5.3'], + ['sqlite_prev', '5.4', [914], '5.3'], + ['sqlite_query', '5.4', [915], '5.3'], + ['sqlite_rewind', '5.4', [916], '5.3'], + ['sqlite_seek', '5.4', [917], '5.3'], + ['sqlite_single_query', '5.4', [918], '5.3'], + ['sqlite_udf_decode_binary', '5.4', [919], '5.3'], + ['sqlite_udf_encode_binary', '5.4', [920], '5.3'], + ['sqlite_unbuffered_query', '5.4', [921], '5.3'], + ['sqlite_valid', '5.4', [922], '5.3'], + + ['php_logo_guid', '5.5', [32], '5.4'], + ['php_egg_logo_guid', '5.5', [33], '5.4'], + ['php_real_logo_guid', '5.5', [34], '5.4'], + ['imagepsbbox', '7.0', [90], '5.6'], + ['imagepsencodefont', '7.0', [91], '5.6'], + ['imagepsextendfont', '7.0', [92], '5.6'], + ['imagepsfreefont', '7.0', [93], '5.6'], + ['imagepsloadfont', '7.0', [94], '5.6'], + ['imagepsslantfont', '7.0', [95], '5.6'], + ['imagepstext', '7.0', [96], '5.6'], + ['mssql_bind', '7.0', [853], '5.6'], + ['mssql_close', '7.0', [854], '5.6'], + ['mssql_connect', '7.0', [855], '5.6'], + ['mssql_data_seek', '7.0', [856], '5.6'], + ['mssql_execute', '7.0', [857], '5.6'], + ['mssql_fetch_array', '7.0', [858], '5.6'], + ['mssql_fetch_assoc', '7.0', [859], '5.6'], + ['mssql_fetch_batch', '7.0', [860], '5.6'], + ['mssql_fetch_field', '7.0', [861], '5.6'], + ['mssql_fetch_object', '7.0', [862], '5.6'], + ['mssql_fetch_row', '7.0', [863], '5.6'], + ['mssql_field_length', '7.0', [864], '5.6'], + ['mssql_field_name', '7.0', [865], '5.6'], + ['mssql_field_seek', '7.0', [866], '5.6'], + ['mssql_field_type', '7.0', [867], '5.6'], + ['mssql_free_result', '7.0', [868], '5.6'], + ['mssql_free_statement', '7.0', [869], '5.6'], + ['mssql_get_last_message', '7.0', [870], '5.6'], + ['mssql_guid_string', '7.0', [871], '5.6'], + ['mssql_init', '7.0', [872], '5.6'], + ['mssql_min_error_severity', '7.0', [873], '5.6'], + ['mssql_min_message_severity', '7.0', [874], '5.6'], + ['mssql_next_result', '7.0', [875], '5.6'], + ['mssql_num_fields', '7.0', [876], '5.6'], + ['mssql_num_rows', '7.0', [877], '5.6'], + ['mssql_pconnect', '7.0', [878], '5.6'], + ['mssql_query', '7.0', [879], '5.6'], + ['mssql_result', '7.0', [880], '5.6'], + ['mssql_rows_affected', '7.0', [881], '5.6'], + ['mssql_select_db', '7.0', [882], '5.6'], + ['sybase_affected_rows', '7.0', [1081], '5.6'], + ['sybase_close', '7.0', [1082], '5.6'], + ['sybase_connect', '7.0', [1083], '5.6'], + ['sybase_data_seek', '7.0', [1084], '5.6'], + ['sybase_deadlock_retry_count', '7.0', [1085], '5.6'], + ['sybase_fetch_array', '7.0', [1086], '5.6'], + ['sybase_fetch_assoc', '7.0', [1087], '5.6'], + ['sybase_fetch_field', '7.0', [1088], '5.6'], + ['sybase_fetch_object', '7.0', [1089], '5.6'], + ['sybase_fetch_row', '7.0', [1090], '5.6'], + ['sybase_field_seek', '7.0', [1091], '5.6'], + ['sybase_free_result', '7.0', [1092], '5.6'], + ['sybase_get_last_message', '7.0', [1093], '5.6'], + ['sybase_min_client_severity', '7.0', [1094], '5.6'], + ['sybase_min_error_severity', '7.0', [1095], '5.6'], + ['sybase_min_message_severity', '7.0', [1096], '5.6'], + ['sybase_min_server_severity', '7.0', [1097], '5.6'], + ['sybase_num_fields', '7.0', [1098], '5.6'], + ['sybase_num_rows', '7.0', [1099], '5.6'], + ['sybase_pconnect', '7.0', [1100], '5.6'], + ['sybase_query', '7.0', [1101], '5.6'], + ['sybase_result', '7.0', [1102], '5.6'], + ['sybase_select_db', '7.0', [1103], '5.6'], + ['sybase_set_message_handler', '7.0', [1104], '5.6'], + ['sybase_unbuffered_query', '7.0', [1105], '5.6'], + + ['php_check_syntax', '5.0.5', [98], '5.0', '5.1'], + ['mysqli_get_cache_stats', '5.4', [99], '5.3'], + ['ibase_add_user', '7.4', [171], '7.3'], + ['ibase_affected_rows', '7.4', [172], '7.3'], + ['ibase_backup', '7.4', [173], '7.3'], + ['ibase_blob_add', '7.4', [174], '7.3'], + ['ibase_blob_cancel', '7.4', [175], '7.3'], + ['ibase_blob_close', '7.4', [176], '7.3'], + ['ibase_blob_create', '7.4', [177], '7.3'], + ['ibase_blob_echo', '7.4', [178], '7.3'], + ['ibase_blob_get', '7.4', [179], '7.3'], + ['ibase_blob_import', '7.4', [180], '7.3'], + ['ibase_blob_info', '7.4', [181], '7.3'], + ['ibase_blob_open', '7.4', [182], '7.3'], + ['ibase_close', '7.4', [183], '7.3'], + ['ibase_commit_ret', '7.4', [184], '7.3'], + ['ibase_commit', '7.4', [185], '7.3'], + ['ibase_connect', '7.4', [186], '7.3'], + ['ibase_db_info', '7.4', [187], '7.3'], + ['ibase_delete_user', '7.4', [188], '7.3'], + ['ibase_drop_db', '7.4', [189], '7.3'], + ['ibase_errcode', '7.4', [190], '7.3'], + ['ibase_errmsg', '7.4', [191], '7.3'], + ['ibase_execute', '7.4', [192], '7.3'], + ['ibase_fetch_assoc', '7.4', [193], '7.3'], + ['ibase_fetch_object', '7.4', [194], '7.3'], + ['ibase_fetch_row', '7.4', [195], '7.3'], + ['ibase_field_info', '7.4', [196], '7.3'], + ['ibase_free_event_handler', '7.4', [197], '7.3'], + ['ibase_free_query', '7.4', [198], '7.3'], + ['ibase_free_result', '7.4', [199], '7.3'], + ['ibase_gen_id', '7.4', [200], '7.3'], + ['ibase_maintain_db', '7.4', [201], '7.3'], + ['ibase_modify_user', '7.4', [202], '7.3'], + ['ibase_name_result', '7.4', [203], '7.3'], + ['ibase_num_fields', '7.4', [204], '7.3'], + ['ibase_num_params', '7.4', [205], '7.3'], + ['ibase_param_info', '7.4', [206], '7.3'], + ['ibase_pconnect', '7.4', [207], '7.3'], + ['ibase_prepare', '7.4', [208], '7.3'], + ['ibase_query', '7.4', [209], '7.3'], + ['ibase_restore', '7.4', [210], '7.3'], + ['ibase_rollback_ret', '7.4', [211], '7.3'], + ['ibase_rollback', '7.4', [212], '7.3'], + ['ibase_server_info', '7.4', [213], '7.3'], + ['ibase_service_attach', '7.4', [214], '7.3'], + ['ibase_service_detach', '7.4', [215], '7.3'], + ['ibase_set_event_handler', '7.4', [216], '7.3'], + ['ibase_trans', '7.4', [217], '7.3'], + ['ibase_wait_event', '7.4', [218], '7.3'], + ['fbird_add_user', '7.4', [987], '7.3'], + ['fbird_affected_rows', '7.4', [988], '7.3'], + ['fbird_backup', '7.4', [989], '7.3'], + ['fbird_blob_add', '7.4', [990], '7.3'], + ['fbird_blob_cancel', '7.4', [991], '7.3'], + ['fbird_blob_close', '7.4', [992], '7.3'], + ['fbird_blob_create', '7.4', [993], '7.3'], + ['fbird_blob_echo', '7.4', [994], '7.3'], + ['fbird_blob_get', '7.4', [995], '7.3'], + ['fbird_blob_import', '7.4', [996], '7.3'], + ['fbird_blob_info', '7.4', [997], '7.3'], + ['fbird_blob_open', '7.4', [998], '7.3'], + ['fbird_close', '7.4', [999], '7.3'], + ['fbird_commit_ret', '7.4', [1000], '7.3'], + ['fbird_commit', '7.4', [1001], '7.3'], + ['fbird_connect', '7.4', [1002], '7.3'], + ['fbird_db_info', '7.4', [1003], '7.3'], + ['fbird_delete_user', '7.4', [1004], '7.3'], + ['fbird_drop_db', '7.4', [1005], '7.3'], + ['fbird_errcode', '7.4', [1006], '7.3'], + ['fbird_errmsg', '7.4', [1007], '7.3'], + ['fbird_execute', '7.4', [1008], '7.3'], + ['fbird_fetch_assoc', '7.4', [1009], '7.3'], + ['fbird_fetch_object', '7.4', [1010], '7.3'], + ['fbird_fetch_row', '7.4', [1011], '7.3'], + ['fbird_field_info', '7.4', [1012], '7.3'], + ['fbird_free_event_handler', '7.4', [1013], '7.3'], + ['fbird_free_query', '7.4', [1014], '7.3'], + ['fbird_free_result', '7.4', [1015], '7.3'], + ['fbird_gen_id', '7.4', [1016], '7.3'], + ['fbird_maintain_db', '7.4', [1017], '7.3'], + ['fbird_modify_user', '7.4', [1018], '7.3'], + ['fbird_name_result', '7.4', [1019], '7.3'], + ['fbird_num_fields', '7.4', [1020], '7.3'], + ['fbird_num_params', '7.4', [1021], '7.3'], + ['fbird_param_info', '7.4', [1022], '7.3'], + ['fbird_pconnect', '7.4', [1023], '7.3'], + ['fbird_prepare', '7.4', [1024], '7.3'], + ['fbird_query', '7.4', [1025], '7.3'], + ['fbird_restore', '7.4', [1026], '7.3'], + ['fbird_rollback_ret', '7.4', [1027], '7.3'], + ['fbird_rollback', '7.4', [1028], '7.3'], + ['fbird_server_info', '7.4', [1029], '7.3'], + ['fbird_service_attach', '7.4', [1030], '7.3'], + ['fbird_service_detach', '7.4', [1031], '7.3'], + ['fbird_set_event_handler', '7.4', [1032], '7.3'], + ['fbird_trans', '7.4', [1033], '7.3'], + ['fbird_wait_event', '7.4', [1034], '7.3'], + + ['wddx_add_vars', '7.4', [228], '7.3'], + ['wddx_deserialize', '7.4', [229], '7.3'], + ['wddx_packet_end', '7.4', [230], '7.3'], + ['wddx_packet_start', '7.4', [231], '7.3'], + ['wddx_serialize_value', '7.4', [232], '7.3'], + ['wddx_serialize_vars', '7.4', [233], '7.3'], + ['mysqli_embedded_server_end', '7.4', [1147], '7.3'], + ['mysqli_embedded_server_start', '7.4', [1148], '7.3'], + + ['oci_internal_debug', '8.0', [1178], '7.4'], + ['xmlrpc_decode_request', '8.0', [1158], '7.4'], + ['xmlrpc_decode', '8.0', [1159], '7.4'], + ['xmlrpc_encode_request', '8.0', [1160], '7.4'], + ['xmlrpc_encode', '8.0', [1161], '7.4'], + ['xmlrpc_get_type', '8.0', [1162], '7.4'], + ['xmlrpc_is_fault', '8.0', [1163], '7.4'], + ['xmlrpc_parse_method_descriptions', '8.0', [1164], '7.4'], + ['xmlrpc_server_add_introspection_data', '8.0', [1165], '7.4'], + ['xmlrpc_server_call_method', '8.0', [1166], '7.4'], + ['xmlrpc_server_create', '8.0', [1167], '7.4'], + ['xmlrpc_server_destroy', '8.0', [1168], '7.4'], + ['xmlrpc_server_register_introspection_callback', '8.0', [1169], '7.4'], + ['xmlrpc_server_register_method', '8.0', [1170], '7.4'], + ['xmlrpc_set_type', '8.0', [1171], '7.4'], + ]; + } + + + /** + * testRemovedFunctionWithAlternative + * + * @dataProvider dataRemovedFunctionWithAlternative + * + * @param string $functionName Name of the function. + * @param string $removedIn The PHP version in which the function was removed. + * @param string $alternative An alternative function. + * @param array $lines The line numbers in the test file which apply to this function. + * @param string $okVersion A PHP version in which the function was still valid. + * @param string $removedVersion Optional PHP version to test removed message with - + * if different from the $removedIn version. + * + * @return void + */ + public function testRemovedFunctionWithAlternative($functionName, $removedIn, $alternative, $lines, $okVersion, $removedVersion = null) + { + $file = $this->sniffFile(__FILE__, $okVersion); + foreach ($lines as $line) { + $this->assertNoViolation($file, $line); + } + + $errorVersion = (isset($removedVersion)) ? $removedVersion : $removedIn; + $file = $this->sniffFile(__FILE__, $errorVersion); + $error = "Function {$functionName}() is removed since PHP {$removedIn}; Use {$alternative} instead"; + foreach ($lines as $line) { + $this->assertError($file, $line, $error); + } + } + + /** + * Data provider. + * + * @see testRemovedFunctionWithAlternative() + * + * @return array + */ + public function dataRemovedFunctionWithAlternative() + { + return [ + ['zend_logo_guid', '5.5', 'text string "PHPE9568F35-D428-11d2-A769-00AA001ACF42"', [35], '5.4'], + + ['recode_file', '7.4', 'the iconv or mbstring extension', [236], '7.3'], + ['recode_string', '7.4', 'the iconv or mbstring extension', [237], '7.3'], + ['recode', '7.4', 'the iconv or mbstring extension', [238], '7.3'], + + ['imap_header', '8.0', 'imap_headerinfo()', [1216], '7.4'], + ]; + } + + + /** + * testDeprecatedRemovedFunction + * + * @dataProvider dataDeprecatedRemovedFunction + * + * @param string $functionName Name of the function. + * @param string $deprecatedIn The PHP version in which the function was deprecated. + * @param string $removedIn The PHP version in which the function was removed. + * @param array $lines The line numbers in the test file which apply to this function. + * @param string $okVersion A PHP version in which the function was still valid. + * @param string $deprecatedVersion Optional PHP version to test deprecation message with - + * if different from the $deprecatedIn version. + * @param string $removedVersion Optional PHP version to test removed message with - + * if different from the $removedIn version. + * + * @return void + */ + public function testDeprecatedRemovedFunction($functionName, $deprecatedIn, $removedIn, $lines, $okVersion, $deprecatedVersion = null, $removedVersion = null) + { + $file = $this->sniffFile(__FILE__, $okVersion); + foreach ($lines as $line) { + $this->assertNoViolation($file, $line); + } + + $errorVersion = (isset($deprecatedVersion)) ? $deprecatedVersion : $deprecatedIn; + $file = $this->sniffFile(__FILE__, $errorVersion); + $error = "Function {$functionName}() is deprecated since PHP {$deprecatedIn}"; + foreach ($lines as $line) { + $this->assertWarning($file, $line, $error); + } + + $errorVersion = (isset($removedVersion)) ? $removedVersion : $removedIn; + $file = $this->sniffFile(__FILE__, $errorVersion); + $error = "Function {$functionName}() is deprecated since PHP {$deprecatedIn} and removed since PHP {$removedIn}"; + foreach ($lines as $line) { + $this->assertError($file, $line, $error); + } + } + + /** + * Data provider. + * + * @see testDeprecatedRemovedFunction() + * + * @return array + */ + public function dataDeprecatedRemovedFunction() + { + return [ + ['define_syslog_variables', '5.3', '5.4', [5], '5.2'], + ['import_request_variables', '5.3', '5.4', [11], '5.2'], + ['mysql_list_dbs', '5.4', '7.0', [15], '5.3'], + ['magic_quotes_runtime', '5.3', '7.0', [23], '5.2'], + ['set_magic_quotes_runtime', '5.3', '7.0', [27], '5.2'], + ['sql_regcase', '5.3', '7.0', [31], '5.2'], + ['mysql_affected_rows', '5.5', '7.0', [923], '5.4'], + ['mysql_client_encoding', '5.5', '7.0', [924], '5.4'], + ['mysql_close', '5.5', '7.0', [925], '5.4'], + ['mysql_connect', '5.5', '7.0', [926], '5.4'], + ['mysql_create_db', '4.3', '7.0', [927], '4.2'], + ['mysql_data_seek', '5.5', '7.0', [928], '5.4'], + ['mysql_db_name', '5.5', '7.0', [929], '5.4'], + ['mysql_drop_db', '4.3', '7.0', [930], '4.2'], + ['mysql_errno', '5.5', '7.0', [931], '5.4'], + ['mysql_error', '5.5', '7.0', [932], '5.4'], + ['mysql_fetch_array', '5.5', '7.0', [933], '5.4'], + ['mysql_fetch_assoc', '5.5', '7.0', [934], '5.4'], + ['mysql_fetch_field', '5.5', '7.0', [935], '5.4'], + ['mysql_fetch_lengths', '5.5', '7.0', [936], '5.4'], + ['mysql_fetch_object', '5.5', '7.0', [937], '5.4'], + ['mysql_fetch_row', '5.5', '7.0', [938], '5.4'], + ['mysql_field_flags', '5.5', '7.0', [939], '5.4'], + ['mysql_field_len', '5.5', '7.0', [940], '5.4'], + ['mysql_field_name', '5.5', '7.0', [941], '5.4'], + ['mysql_field_seek', '5.5', '7.0', [942], '5.4'], + ['mysql_field_table', '5.5', '7.0', [943], '5.4'], + ['mysql_field_type', '5.5', '7.0', [944], '5.4'], + ['mysql_free_result', '5.5', '7.0', [945], '5.4'], + ['mysql_get_client_info', '5.5', '7.0', [946], '5.4'], + ['mysql_get_host_info', '5.5', '7.0', [947], '5.4'], + ['mysql_get_proto_info', '5.5', '7.0', [948], '5.4'], + ['mysql_get_server_info', '5.5', '7.0', [949], '5.4'], + ['mysql_info', '5.5', '7.0', [950], '5.4'], + ['mysql_insert_id', '5.5', '7.0', [951], '5.4'], + ['mysql_list_fields', '5.4', '7.0', [952], '5.3'], + ['mysql_list_processes', '5.5', '7.0', [953], '5.4'], + ['mysql_list_tables', '4.3.7', '7.0', [954], '4.3', '4.4'], + ['mysql_num_fields', '5.5', '7.0', [955], '5.4'], + ['mysql_num_rows', '5.5', '7.0', [956], '5.4'], + ['mysql_pconnect', '5.5', '7.0', [957], '5.4'], + ['mysql_ping', '5.5', '7.0', [958], '5.4'], + ['mysql_query', '5.5', '7.0', [959], '5.4'], + ['mysql_real_escape_string', '5.5', '7.0', [960], '5.4'], + ['mysql_result', '5.5', '7.0', [961], '5.4'], + ['mysql_select_db', '5.5', '7.0', [962], '5.4'], + ['mysql_set_charset', '5.5', '7.0', [963], '5.4'], + ['mysql_stat', '5.5', '7.0', [964], '5.4'], + ['mysql_tablename', '5.5', '7.0', [965], '5.4'], + ['mysql_thread_id', '5.5', '7.0', [966], '5.4'], + ['mysql_unbuffered_query', '5.5', '7.0', [967], '5.4'], + ['mysql', '5.5', '7.0', [968], '5.4'], + ['mysql_fieldname', '5.5', '7.0', [969], '5.4'], + ['mysql_fieldtable', '5.5', '7.0', [970], '5.4'], + ['mysql_fieldlen', '5.5', '7.0', [971], '5.4'], + ['mysql_fieldtype', '5.5', '7.0', [972], '5.4'], + ['mysql_fieldflags', '5.5', '7.0', [973], '5.4'], + ['mysql_selectdb', '5.5', '7.0', [974], '5.4'], + ['mysql_freeresult', '5.5', '7.0', [977], '5.4'], + ['mysql_numfields', '5.5', '7.0', [978], '5.4'], + ['mysql_numrows', '5.5', '7.0', [979], '5.4'], + ['mysql_listdbs', '5.5', '7.0', [980], '5.4'], + ['mysql_listfields', '5.5', '7.0', [982], '5.4'], + ['mysql_dbname', '5.5', '7.0', [983], '5.4'], + ['mysql_table_name', '5.5', '7.0', [984], '5.4'], + + ['ldap_sort', '7.0', '8.0', [97], '5.6'], + ['fgetss', '7.3', '8.0', [167], '7.2'], + ['gzgetss', '7.3', '8.0', [168], '7.2'], + ['ezmlm_hash', '7.4', '8.0', [245], '7.3'], + ['get_magic_quotes_gpc', '7.4', '8.0', [240], '7.3'], + ['get_magic_quotes_runtime', '7.4', '8.0', [241], '7.3'], + ['hebrevc', '7.4', '8.0', [242], '7.3'], + ]; + } + + + /** + * testDeprecatedRemovedFunctionWithAlternative + * + * @dataProvider dataDeprecatedRemovedFunctionWithAlternative + * + * @param string $functionName Name of the function. + * @param string $deprecatedIn The PHP version in which the function was deprecated. + * @param string $removedIn The PHP version in which the function was removed. + * @param string $alternative An alternative function. + * @param array $lines The line numbers in the test file which apply to this function. + * @param string $okVersion A PHP version in which the function was still valid. + * @param string $deprecatedVersion Optional PHP version to test deprecation message with - + * if different from the $deprecatedIn version. + * @param string $removedVersion Optional PHP version to test removed message with - + * if different from the $removedIn version. + * + * @return void + */ + public function testDeprecatedRemovedFunctionWithAlternative($functionName, $deprecatedIn, $removedIn, $alternative, $lines, $okVersion, $deprecatedVersion = null, $removedVersion = null) + { + $file = $this->sniffFile(__FILE__, $okVersion); + foreach ($lines as $line) { + $this->assertNoViolation($file, $line); + } + + $errorVersion = (isset($deprecatedVersion)) ? $deprecatedVersion : $deprecatedIn; + $file = $this->sniffFile(__FILE__, $errorVersion); + $error = "Function {$functionName}() is deprecated since PHP {$deprecatedIn}; Use {$alternative} instead"; + foreach ($lines as $line) { + $this->assertWarning($file, $line, $error); + } + + $errorVersion = (isset($removedVersion)) ? $removedVersion : $removedIn; + $file = $this->sniffFile(__FILE__, $errorVersion); + $error = "Function {$functionName}() is deprecated since PHP {$deprecatedIn} and removed since PHP {$removedIn}; Use {$alternative} instead"; + foreach ($lines as $line) { + $this->assertError($file, $line, $error); + } + } + + /** + * Data provider. + * + * @see testDeprecatedRemovedFunctionWithAlternative() + * + * @return array + */ + public function dataDeprecatedRemovedFunctionWithAlternative() + { + return [ + ['call_user_method', '4.1', '7.0', 'call_user_func()', [3], '4.0'], + ['call_user_method_array', '4.1', '7.0', 'call_user_func_array()', [4], '4.0'], + ['ereg', '5.3', '7.0', 'preg_match()', [7], '5.2'], + ['ereg_replace', '5.3', '7.0', 'preg_replace()', [8], '5.2'], + ['eregi', '5.3', '7.0', 'preg_match() (with the i modifier)', [9], '5.2'], + ['eregi_replace', '5.3', '7.0', 'preg_replace() (with the i modifier)', [10], '5.2'], + ['mcrypt_generic_end', '5.3', '7.0', 'mcrypt_generic_deinit()', [12], '5.2'], + ['mcrypt_ecb', '5.5', '7.0', 'mcrypt_decrypt()/mcrypt_encrypt()', [37], '5.4'], + ['mcrypt_cbc', '5.5', '7.0', 'mcrypt_decrypt()/mcrypt_encrypt()', [38], '5.4'], + ['mcrypt_cfb', '5.5', '7.0', 'mcrypt_decrypt()/mcrypt_encrypt()', [39], '5.4'], + ['mcrypt_ofb', '5.5', '7.0', 'mcrypt_decrypt()/mcrypt_encrypt()', [40], '5.4'], + ['mysql_db_query', '5.3', '7.0', 'mysqli::select_db() and mysqli::query()', [13], '5.2'], + ['mysql_escape_string', '4.3', '7.0', 'mysqli::real_escape_string()', [14], '4.2'], + ['mysqli_bind_param', '5.3', '5.4', 'mysqli_stmt::bind_param()', [16], '5.2'], + ['mysqli_bind_result', '5.3', '5.4', 'mysqli_stmt::bind_result()', [17], '5.2'], + ['mysqli_client_encoding', '5.3', '5.4', 'mysqli::character_set_name()', [18], '5.2'], + ['mysqli_fetch', '5.3', '5.4', 'mysqli_stmt::fetch()', [19], '5.2'], + ['mysqli_param_count', '5.3', '5.4', 'mysqli_stmt_param_count()', [20], '5.2'], + ['mysqli_get_metadata', '5.3', '5.4', 'mysqli_stmt::result_metadata()', [21], '5.2'], + ['mysqli_send_long_data', '5.3', '5.4', 'mysqli_stmt::send_long_data()', [22], '5.2'], + ['session_register', '5.3', '5.4', '$_SESSION', [24], '5.2'], + ['session_unregister', '5.3', '5.4', '$_SESSION', [25], '5.2'], + ['session_is_registered', '5.3', '5.4', '$_SESSION', [26], '5.2'], + ['set_socket_blocking', '5.3', '7.0', 'stream_set_blocking()', [28], '5.2'], + ['split', '5.3', '7.0', 'preg_split(), explode() or str_split()', [29], '5.2'], + ['spliti', '5.3', '7.0', 'preg_split() (with the i modifier)', [30], '5.2'], + ['datefmt_set_timezone_id', '5.5', '7.0', 'IntlDateFormatter::setTimeZone()', [36], '5.4'], + + ['mcrypt_create_iv', '7.1', '7.2', 'random_bytes() or OpenSSL', [100], '7.0'], + ['mcrypt_decrypt', '7.1', '7.2', 'OpenSSL', [101], '7.0'], + ['mcrypt_enc_get_algorithms_name', '7.1', '7.2', 'OpenSSL', [102], '7.0'], + ['mcrypt_enc_get_block_size', '7.1', '7.2', 'OpenSSL', [103], '7.0'], + ['mcrypt_enc_get_iv_size', '7.1', '7.2', 'OpenSSL', [104], '7.0'], + ['mcrypt_enc_get_key_size', '7.1', '7.2', 'OpenSSL', [105], '7.0'], + ['mcrypt_enc_get_modes_name', '7.1', '7.2', 'OpenSSL', [106], '7.0'], + ['mcrypt_enc_get_supported_key_sizes', '7.1', '7.2', 'OpenSSL', [107], '7.0'], + ['mcrypt_enc_is_block_algorithm_mode', '7.1', '7.2', 'OpenSSL', [108], '7.0'], + ['mcrypt_enc_is_block_algorithm', '7.1', '7.2', 'OpenSSL', [109], '7.0'], + ['mcrypt_enc_is_block_mode', '7.1', '7.2', 'OpenSSL', [110], '7.0'], + ['mcrypt_enc_self_test', '7.1', '7.2', 'OpenSSL', [111], '7.0'], + ['mcrypt_encrypt', '7.1', '7.2', 'OpenSSL', [112], '7.0'], + ['mcrypt_generic_deinit', '7.1', '7.2', 'OpenSSL', [113], '7.0'], + ['mcrypt_generic_init', '7.1', '7.2', 'OpenSSL', [114], '7.0'], + ['mcrypt_generic', '7.1', '7.2', 'OpenSSL', [115], '7.0'], + ['mcrypt_get_block_size', '7.1', '7.2', 'OpenSSL', [116], '7.0'], + ['mcrypt_get_cipher_name', '7.1', '7.2', 'OpenSSL', [117], '7.0'], + ['mcrypt_get_iv_size', '7.1', '7.2', 'OpenSSL', [118], '7.0'], + ['mcrypt_get_key_size', '7.1', '7.2', 'OpenSSL', [119], '7.0'], + ['mcrypt_list_algorithms', '7.1', '7.2', 'OpenSSL', [120], '7.0'], + ['mcrypt_list_modes', '7.1', '7.2', 'OpenSSL', [121], '7.0'], + ['mcrypt_module_close', '7.1', '7.2', 'OpenSSL', [122], '7.0'], + ['mcrypt_module_get_algo_block_size', '7.1', '7.2', 'OpenSSL', [123], '7.0'], + ['mcrypt_module_get_algo_key_size', '7.1', '7.2', 'OpenSSL', [124], '7.0'], + ['mcrypt_module_get_supported_key_sizes', '7.1', '7.2', 'OpenSSL', [125], '7.0'], + ['mcrypt_module_is_block_algorithm_mode', '7.1', '7.2', 'OpenSSL', [126], '7.0'], + ['mcrypt_module_is_block_algorithm', '7.1', '7.2', 'OpenSSL', [127], '7.0'], + ['mcrypt_module_is_block_mode', '7.1', '7.2', 'OpenSSL', [128], '7.0'], + ['mcrypt_module_open', '7.1', '7.2', 'OpenSSL', [129], '7.0'], + ['mcrypt_module_self_test', '7.1', '7.2', 'OpenSSL', [130], '7.0'], + ['mdecrypt_generic', '7.1', '7.2', 'OpenSSL', [131], '7.0'], + + ['create_function', '7.2', '8.0', 'an anonymous function', [146], '7.1'], + ['each', '7.2', '8.0', 'a foreach loop or ArrayIterator', [147], '7.1'], + ['read_exif_data', '7.2', '8.0', 'exif_read_data()', [149], '7.1'], + ['jpeg2wbmp', '7.2', '8.0', 'imagecreatefromjpeg() and imagewbmp()', [144], '7.1'], + ['png2wbmp', '7.2', '8.0', 'imagecreatefrompng() or imagewbmp()', [145], '7.1'], + ['gmp_random', '7.2', '8.0', 'gmp_random_bits() or gmp_random_range()', [148], '7.1'], + + ['image2wbmp', '7.3', '8.0', 'imagewbmp()', [152], '7.2'], + ['mbregex_encoding', '7.3', '8.0', 'mb_regex_encoding()', [153], '7.2'], + ['mbereg', '7.3', '8.0', 'mb_ereg()', [154], '7.2'], + ['mberegi', '7.3', '8.0', 'mb_eregi()', [155], '7.2'], + ['mbereg_replace', '7.3', '8.0', 'mb_ereg_replace()', [156], '7.2'], + ['mberegi_replace', '7.3', '8.0', 'mb_eregi_replace()', [157], '7.2'], + ['mbsplit', '7.3', '8.0', 'mb_split()', [158], '7.2'], + ['mbereg_match', '7.3', '8.0', 'mb_ereg_match()', [159], '7.2'], + ['mbereg_search', '7.3', '8.0', 'mb_ereg_search()', [160], '7.2'], + ['mbereg_search_pos', '7.3', '8.0', 'mb_ereg_search_pos()', [161], '7.2'], + ['mbereg_search_regs', '7.3', '8.0', 'mb_ereg_search_regs()', [162], '7.2'], + ['mbereg_search_init', '7.3', '8.0', 'mb_ereg_search_init()', [163], '7.2'], + ['mbereg_search_getregs', '7.3', '8.0', 'mb_ereg_search_getregs()', [164], '7.2'], + ['mbereg_search_getpos', '7.3', '8.0', 'mb_ereg_search_getpos()', [165], '7.2'], + ['mbereg_search_setpos', '7.3', '8.0', 'mb_ereg_search_setpos()', [166], '7.2'], + + ['convert_cyr_string', '7.4', '8.0', 'mb_convert_encoding(), iconv() or UConverter', [243], '7.3'], + ['money_format', '7.4', '8.0', 'NumberFormatter::formatCurrency()', [244], '7.3'], + ['restore_include_path', '7.4', '8.0', "ini_restore('include_path')", [246], '7.3'], + ['ociinternaldebug', '5.4', '8.0', 'oci_internal_debug() (PHP < 8.0)', [69], '5.3'], + ['ldap_control_paged_result_response', '7.4', '8.0', 'ldap_search()', [234], '7.3'], + ['ldap_control_paged_result', '7.4', '8.0', 'ldap_search()', [235], '7.3'], + ]; + } + + + /** + * testNoFalsePositives + * + * @dataProvider dataNoFalsePositives + * + * @param int $line The line number. + * + * @return void + */ + public function testNoFalsePositives($line) + { + $file = $this->sniffFile(__FILE__, '99.0'); // High version beyond latest deprecation. + $this->assertNoViolation($file, $line); + } + + /** + * Data provider. + * + * @see testNoFalsePositives() + * + * @return array + */ + public function dataNoFalsePositives() + { + return [ + [134], + [135], + [136], + [137], + [138], + [139], + [140], + [141], + [249], + [250], + [251], + [252], + [1232], + ]; + } + + + /** + * Verify no notices are thrown at all. + * + * @return void + */ + public function testNoViolationsInFileOnValidVersion() + { + $file = $this->sniffFile(__FILE__, '4.0'); // Low version below the first deprecation. + $this->assertNoViolation($file); + } +} \ No newline at end of file diff --git a/Magento2/ruleset.xml b/Magento2/ruleset.xml index b26c8a73..6234fb1b 100644 --- a/Magento2/ruleset.xml +++ b/Magento2/ruleset.xml @@ -168,7 +168,7 @@ 10 error - + 10 error @@ -771,6 +771,8 @@ + + - - + + 9 @@ -350,7 +346,7 @@ 8 warning - + 7 @@ -484,7 +480,6 @@ 6 warning - */PHPCompatibility/* 6 @@ -765,25 +760,10 @@ - - - - - - - - - - - - diff --git a/Magento2Framework/ruleset.xml b/Magento2Framework/ruleset.xml index 5e16e7a1..ecdb92da 100644 --- a/Magento2Framework/ruleset.xml +++ b/Magento2Framework/ruleset.xml @@ -7,7 +7,6 @@ 5 warning - */PHPCompatibility/* 5 @@ -18,7 +17,6 @@ 5 warning - */PHPCompatibility/* *\.php$ *\.phtml$ */PHPCSUtils/* diff --git a/PHPCompatibility/AbstractFunctionCallParameterSniff.php b/PHPCompatibility/AbstractFunctionCallParameterSniff.php deleted file mode 100644 index b2660e8b..00000000 --- a/PHPCompatibility/AbstractFunctionCallParameterSniff.php +++ /dev/null @@ -1,204 +0,0 @@ - true, - ]; - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 8.2.0 - * - * @return array - */ - public function register() - { - $this->ignoreTokens += Collections::objectOperators(); - - // Handle case-insensitivity of function names. - $this->targetFunctions = \array_change_key_case($this->targetFunctions, \CASE_LOWER); - - return [\T_STRING]; - } - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function process(File $phpcsFile, $stackPtr) - { - if ($this->bowOutEarly() === true) { - return; - } - - $tokens = $phpcsFile->getTokens(); - $function = $tokens[$stackPtr]['content']; - $functionLc = \strtolower($function); - - if (isset($this->targetFunctions[$functionLc]) === false) { - return; - } - - $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); - if ($nextToken === false - || $tokens[$nextToken]['code'] !== \T_OPEN_PARENTHESIS - || isset($tokens[$nextToken]['parenthesis_owner']) === true - ) { - return; - } - - $prevNonEmpty = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true); - - if ($this->isMethod === true) { - if (isset(Collections::objectOperators()[$tokens[$prevNonEmpty]['code']]) === false) { - // Not a call to a PHP method. - return; - } - } else { - if (isset($this->ignoreTokens[$tokens[$prevNonEmpty]['code']]) === true) { - // Not a call to a PHP function. - return; - } - - if ($tokens[$prevNonEmpty]['code'] === \T_NS_SEPARATOR) { - $prevPrevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevNonEmpty - 1), null, true); - if ($tokens[$prevPrevToken]['code'] === \T_STRING - || $tokens[$prevPrevToken]['code'] === \T_NAMESPACE - ) { - // Namespaced function. - return; - } - } - } - - $parameters = PassedParameters::getParameters($phpcsFile, $stackPtr); - - if (empty($parameters)) { - return $this->processNoParameters($phpcsFile, $stackPtr, $function); - } else { - return $this->processParameters($phpcsFile, $stackPtr, $function, $parameters); - } - } - - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 8.2.0 - * - * If the check done in a child class is not specific to one PHP version, - * this function should return `false`. - * - * @return bool - */ - abstract protected function bowOutEarly(); - - - /** - * Process the parameters of a matched function. - * - * This method has to be made concrete in child classes. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - abstract public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters); - - - /** - * Process the function if no parameters were found. - * - * Defaults to doing nothing. Can be overloaded in child classes to handle functions - * were parameters are expected, but none found. - * - * @since 8.2.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processNoParameters(File $phpcsFile, $stackPtr, $functionName) - { - return; - } -} diff --git a/PHPCompatibility/LICENSE b/PHPCompatibility/LICENSE deleted file mode 100644 index 65c5ca88..00000000 --- a/PHPCompatibility/LICENSE +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenFinalPrivateMethodsSniff.php b/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenFinalPrivateMethodsSniff.php deleted file mode 100644 index 40954070..00000000 --- a/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenFinalPrivateMethodsSniff.php +++ /dev/null @@ -1,96 +0,0 @@ - Due to how common the usage of `final private function __construct` is and given that - * > the same results cannot be achieved with a protected visibility, an exception to this rule - * > is made for constructors. - * - * PHP version 8.0 - * - * @link https://wiki.php.net/rfc/inheritance_private_methods - * - * @since 10.0.0 - */ -class ForbiddenFinalPrivateMethodsSniff extends Sniff -{ - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 10.0.0 - * - * @return array - */ - public function register() - { - return [\T_FUNCTION]; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 10.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - if ($this->supportsAbove('8.0') === false) { - return; - } - - if (Scopes::isOOMethod($phpcsFile, $stackPtr) === false) { - // Function, not method. - return; - } - - $name = FunctionDeclarations::getName($phpcsFile, $stackPtr); - if (empty($name) === true) { - // Parse error or live coding. - return; - } - - if (\strtolower($name) === '__construct') { - // The rule does not apply to constructors. Bow out. - return; - } - - $properties = FunctionDeclarations::getProperties($phpcsFile, $stackPtr); - if ($properties['scope'] !== 'private' || $properties['is_final'] === false) { - // Not an private final method. - return; - } - - $phpcsFile->addWarning( - 'Private methods should not be declared as final since PHP 8.0', - $stackPtr, - 'Found' - ); - } -} diff --git a/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedCallingDestructAfterConstructorExitSniff.php b/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedCallingDestructAfterConstructorExitSniff.php deleted file mode 100644 index c59343d0..00000000 --- a/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedCallingDestructAfterConstructorExitSniff.php +++ /dev/null @@ -1,214 +0,0 @@ -supportsAbove('8.0') === false) { - return; - } - - // Note: interface constructors cannot contain code, enums cannot contain constructors or destructors. - $classPtr = Scopes::validDirectScope($phpcsFile, $stackPtr, [\T_CLASS, \T_ANON_CLASS, \T_TRAIT]); - if ($classPtr === false) { - // Function, not method. - return; - } - - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false - || isset($tokens[$classPtr]['scope_opener'], $tokens[$classPtr]['scope_closer']) === false - ) { - // Parse error, tokenizer error or live coding. - return; - } - - $name = FunctionDeclarations::getName($phpcsFile, $stackPtr); - if (empty($name) === true) { - // Parse error or live coding. - return; - } - - if (\strtolower($name) !== '__construct') { - // The rule only applies to constructors. Bow out. - return; - } - - $functionOpen = $tokens[$stackPtr]['scope_opener']; - $functionClose = $tokens[$stackPtr]['scope_closer']; - $exits = []; - for ($current = ($functionOpen + 1); $current < $functionClose; $current++) { - if (isset(Tokens::$emptyTokens[$tokens[$current]['code']]) === true) { - continue; - } - - if ($tokens[$current]['code'] === \T_EXIT) { - $exits[] = $current; - continue; - } - - // Skip over nested closed scopes as much as possible for efficiency. - // Ignore arrow functions as they aren't closed scopes. - if (isset(Collections::closedScopes()[$tokens[$current]['code']]) === true - && isset($tokens[$current]['scope_closer']) === true - ) { - $current = $tokens[$current]['scope_closer']; - continue; - } - - // Skip over array access and short arrays/lists, but not control structures. - if (isset($tokens[$current]['bracket_closer']) === true - && isset($tokens[$current]['scope_closer']) === false - ) { - $current = $tokens[$current]['bracket_closer']; - continue; - } - - // Skip over long array/lists as they can't contain an exit statement, except within a closed scope. - if (($tokens[$current]['code'] === \T_ARRAY || $tokens[$current]['code'] === \T_LIST) - && isset($tokens[$current]['parenthesis_closer']) === true - ) { - $current = $tokens[$current]['parenthesis_closer']; - continue; - } - } - - if (empty($exits) === true) { - // No calls to exit or die found. - return; - } - - $hasDestruct = false; - $usesTraits = false; - $isError = false; - $classOpen = $tokens[$classPtr]['scope_opener']; - $classClose = $tokens[$classPtr]['scope_closer']; - $nextFunc = $classOpen; - - while (($nextFunc = $phpcsFile->findNext([\T_FUNCTION, \T_DOC_COMMENT_OPEN_TAG, \T_ATTRIBUTE, \T_USE], ($nextFunc + 1), $classClose)) !== false) { - // Skip over docblocks. - if ($tokens[$nextFunc]['code'] === \T_DOC_COMMENT_OPEN_TAG) { - $nextFunc = $tokens[$nextFunc]['comment_closer']; - continue; - } - - // Skip over attributes. - if ($tokens[$nextFunc]['code'] === \T_ATTRIBUTE - && isset($tokens[$nextFunc]['attribute_closer']) - ) { - $nextFunc = $tokens[$nextFunc]['attribute_closer']; - continue; - } - - if ($tokens[$nextFunc]['code'] === \T_USE - && UseStatements::isTraitUse($phpcsFile, $nextFunc) === true - ) { - $usesTraits = true; - continue; - } - - $functionScopeCloser = $nextFunc; - if (isset($tokens[$nextFunc]['scope_closer'])) { - // Normal (non-abstract) method. - $functionScopeCloser = $tokens[$nextFunc]['scope_closer']; - } - - $funcName = FunctionDeclarations::getName($phpcsFile, $nextFunc); - $nextFunc = $functionScopeCloser; // Set up to skip over the method content. - - if (empty($funcName) === true) { - continue; - } - - if (\strtolower($funcName) !== '__destruct') { - continue; - } - - $hasDestruct = true; - $isError = true; - break; - } - - if ($hasDestruct === false && $usesTraits === false) { - /* - * No destruct method or trait use found, check if this class extends another one - * which may contain a destruct method. - */ - $extends = ObjectDeclarations::findExtendedClassName($phpcsFile, $classPtr); - if (empty($extends) === true) { - // No destruct method and class doesn't extend nor uses traits, so the calls to exit can be ignored. - return; - } - } - - /* - * Ok, either a destruct method has been found and we can throw an error, or either a class extends - * or trait use has been found and no destruct method, in which case, we throw a warning. - */ - $error = 'When %s() is called within an object constructor, the object destructor will no longer be called since PHP 8.0'; - $errorCode = 'Found'; - if ($isError === false) { - $error .= ' While no __destruct() method was found in this class, one may be declared in the parent class or in a trait being used.'; - $errorCode = 'NeedsInspection'; - } - - foreach ($exits as $ptr) { - MessageHelper::addMessage($phpcsFile, $error, $ptr, $isError, $errorCode, [$tokens[$ptr]['content']]); - } - } -} diff --git a/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedOptionalBeforeRequiredParamSniff.php b/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedOptionalBeforeRequiredParamSniff.php deleted file mode 100644 index 07b93d12..00000000 --- a/PHPCompatibility/Sniffs/FunctionDeclarations/RemovedOptionalBeforeRequiredParamSniff.php +++ /dev/null @@ -1,146 +0,0 @@ - Declaring a required parameter after an optional one is deprecated. As an - * > exception, declaring a parameter of the form "Type $param = null" before - * > a required one continues to be allowed, because this pattern was sometimes - * > used to achieve nullable types in older PHP versions. - * - * PHP version 8.0 - * - * @link https://github.com/php/php-src/blob/69888c3ff1f2301ead8e37b23ff8481d475e29d2/UPGRADING#L145-L151 - * - * @since 10.0.0 - */ -class RemovedOptionalBeforeRequiredParamSniff extends Sniff -{ - - /** - * Tokens allowed in the default value. - * - * This property will be enriched in the register() method. - * - * @since 10.0.0 - * - * @var array - */ - private $allowedInDefault = [ - \T_NULL => \T_NULL, - ]; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 10.0.0 - * - * @return array - */ - public function register() - { - $this->allowedInDefault += Tokens::$emptyTokens; - - return Collections::functionDeclarationTokens(); - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 10.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - if ($this->supportsAbove('8.0') === false) { - return; - } - - // Get all parameters from the function signature. - $parameters = FunctionDeclarations::getParameters($phpcsFile, $stackPtr); - if (empty($parameters)) { - return; - } - - $error = 'Declaring a required parameter after an optional one is deprecated since PHP 8.0. Parameter %s is optional, while parameter %s is required.'; - - $paramCount = \count($parameters); - $lastKey = ($paramCount - 1); - $firstOptional = null; - - foreach ($parameters as $key => $param) { - /* - * Ignore variadic parameters, which are optional by nature. - * These always have to be declared last and this has been this way since their introduction. - */ - if ($param['variable_length'] === true) { - continue; - } - - // Handle optional parameters. - if (isset($param['default']) === true) { - if ($key === $lastKey) { - // This is the last parameter and it's optional, no further checking needed. - break; - } - - if (isset($firstOptional) === false) { - // Check if it's typed and has a null default value, in which case we can ignore it. - if ($param['type_hint'] !== '') { - $hasNull = $phpcsFile->findNext(\T_NULL, $param['default_token'], $param['comma_token']); - $hasNonNull = $phpcsFile->findNext( - $this->allowedInDefault, - $param['default_token'], - $param['comma_token'], - true - ); - - if ($hasNull !== false && $hasNonNull === false) { - continue; - } - } - - // Non-null default value. This is an optional param we need to take into account. - $firstOptional = $param['name']; - } - - continue; - } - - // Found a required parameter. - if (isset($firstOptional) === false) { - // No optional params found yet. - continue; - } - - // Found a required parameter with an optional param before it. - $data = [ - $firstOptional, - $param['name'], - ]; - - $phpcsFile->addWarning($error, $param['token'], 'Deprecated', $data); - } - } -} diff --git a/PHPCompatibility/Sniffs/ParameterValues/ChangedIntToBoolParamTypeSniff.php b/PHPCompatibility/Sniffs/ParameterValues/ChangedIntToBoolParamTypeSniff.php deleted file mode 100644 index 7428b97b..00000000 --- a/PHPCompatibility/Sniffs/ParameterValues/ChangedIntToBoolParamTypeSniff.php +++ /dev/null @@ -1,124 +0,0 @@ - [ - 1 => [ - 'name' => 'enable', - 'since' => '8.0', - ], - ], - 'sem_get' => [ - 4 => [ - 'name' => 'auto_release', - 'since' => '8.0', - ], - ], - ]; - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * Checks against the first PHP version listed in the above array. - * - * @since 10.0.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsAbove('8.0') === false); - } - - /** - * Process the parameters of a matched function. - * - * @since 10.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - static $search; - - if (isset($search) === false) { - $search = [ - \T_LNUMBER => \T_LNUMBER, - \T_DNUMBER => \T_DNUMBER, - ]; - $search += BCTokens::arithmeticTokens(); - $search += Tokens::$emptyTokens; - } - - $functionLC = \strtolower($functionName); - $functionInfo = $this->targetFunctions[$functionLC]; - foreach ($functionInfo as $offset => $paramInfo) { - if ($this->supportsAbove($paramInfo['since']) === false) { - continue; - } - - $target = PassedParameters::getParameterFromStack($parameters, $offset, $paramInfo['name']); - if ($target === false) { - continue; - } - - $hasNonNumeric = $phpcsFile->findNext($search, $target['start'], ($target['end'] + 1), true); - if ($hasNonNumeric !== false) { - // Not a purely numerical value. Ignore. - continue; - } - - $error = 'The $%s parameter of %s() expects a boolean value instead of an integer since PHP %s. Found: %s'; - $code = MessageHelper::stringToErrorCode($functionLC . '_' . $paramInfo['name'], true) . 'NumericFound'; - $data = [ - $paramInfo['name'], - $functionLC, - $paramInfo['since'], - $target['clean'], - ]; - - $phpcsFile->addError($error, $target['start'], $code, $data); - } - } -} diff --git a/PHPCompatibility/Sniffs/ParameterValues/RemovedAssertStringAssertionSniff.php b/PHPCompatibility/Sniffs/ParameterValues/RemovedAssertStringAssertionSniff.php deleted file mode 100644 index c71dd722..00000000 --- a/PHPCompatibility/Sniffs/ParameterValues/RemovedAssertStringAssertionSniff.php +++ /dev/null @@ -1,134 +0,0 @@ - Usage of a string as the assertion became deprecated. It now emits an E_DEPRECATED - * > notice when both assert.active and zend.assertions are set to 1. - * - * PHP 8.0: - * > assert() will no longer evaluate string arguments, instead they will be treated - * > like any other argument. `assert($a == $b)` should be used instead of `assert('$a == $b')`. - * - * PHP version 7.2 - * PHP version 8.0 - * - * @link https://wiki.php.net/rfc/deprecations_php_7_2#assert_with_string_argument - * @link https://github.com/php/php-src/blob/69888c3ff1f2301ead8e37b23ff8481d475e29d2/UPGRADING#L350-L354 - * @link https://www.php.net/manual/en/function.assert.php#refsect1-function.assert-changelog - * - * @since 10.0.0 - */ -class RemovedAssertStringAssertionSniff extends AbstractFunctionCallParameterSniff -{ - - /** - * Functions to check for. - * - * @since 10.0.0 - * - * @var array - */ - protected $targetFunctions = [ - 'assert' => true, - ]; - - /** - * Target tokens. - * - * If there is anything but any of these tokens in the parameter, we bow out as undetermined. - * - * @since 10.0.0 - * - * @var array - */ - private $targetTokens = []; - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 10.0.0 - * - * @return array - */ - public function register() - { - // Set $targetTokens only once. - $this->targetTokens = Tokens::$emptyTokens; - $this->targetTokens += Tokens::$stringTokens + Tokens::$heredocTokens; - $this->targetTokens[\T_STRING_CONCAT] = \T_STRING_CONCAT; - - return parent::register(); - } - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 10.0.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsAbove('7.2') === false); - } - - /** - * Process the parameters of a matched function. - * - * @since 10.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - if (isset($parameters[1]) === false) { - return; - } - - $targetParam = $parameters[1]; - $hasOther = $phpcsFile->findNext($this->targetTokens, $targetParam['start'], ($targetParam['end'] + 1), true); - if ($hasOther !== false) { - // Some other token was found, unclear whether this is really a text string. Bow out. - return; - } - - $error = 'Using a string as the assertion passed to assert() is deprecated since PHP 7.2%s. Found: %s'; - $code = 'Deprecated'; - $isError = false; - $data = [ - '', - $targetParam['clean'], - ]; - - if ($this->supportsAbove('8.0') === true) { - $data[0] = ' and removed since PHP 8.0'; - $isError = true; - $code = 'Removed'; - } - - MessageHelper::addMessage($phpcsFile, $error, $targetParam['start'], $isError, $code, $data); - } -} diff --git a/PHPCompatibility/Sniffs/ParameterValues/RemovedGetDefinedFunctionsExcludeDisabledFalseSniff.php b/PHPCompatibility/Sniffs/ParameterValues/RemovedGetDefinedFunctionsExcludeDisabledFalseSniff.php deleted file mode 100644 index 32971c1c..00000000 --- a/PHPCompatibility/Sniffs/ParameterValues/RemovedGetDefinedFunctionsExcludeDisabledFalseSniff.php +++ /dev/null @@ -1,85 +0,0 @@ - Calling `get_defined_functions()` with `$exclude_disabled` explicitly set to `false` - * > is deprecated. `get_defined_functions()` will never include disabled functions. - * - * PHP version 8.0 - * - * @link https://github.com/php/php-src/blob/69888c3ff1f2301ead8e37b23ff8481d475e29d2/UPGRADING#L514-L516 - * - * @since 10.0.0 - */ -class RemovedGetDefinedFunctionsExcludeDisabledFalseSniff extends AbstractFunctionCallParameterSniff -{ - - /** - * Functions to check for. - * - * @since 10.0.0 - * - * @var array - */ - protected $targetFunctions = [ - 'get_defined_functions' => true, - ]; - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 10.0.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsAbove('8.0') === false); - } - - /** - * Process the parameters of a matched function. - * - * @since 10.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - $targetParam = PassedParameters::getParameterFromStack($parameters, 1, 'exclude_disabled'); - if ($targetParam === false) { - return; - } - - if ($targetParam['clean'] !== 'false') { - return; - } - - $phpcsFile->addWarning( - 'Explicitly passing "false" as the value for $exclude_disabled to get_defined_functions() is deprecated since PHP 8.0.', - $targetParam['start'], - 'Deprecated' - ); - } -} diff --git a/PHPCompatibility/Sniffs/ParameterValues/RemovedSplAutoloadRegisterThrowFalseSniff.php b/PHPCompatibility/Sniffs/ParameterValues/RemovedSplAutoloadRegisterThrowFalseSniff.php deleted file mode 100644 index fc98b1fa..00000000 --- a/PHPCompatibility/Sniffs/ParameterValues/RemovedSplAutoloadRegisterThrowFalseSniff.php +++ /dev/null @@ -1,86 +0,0 @@ - spl_autoload_register() will now always throw a TypeError on invalid - * > arguments, therefore the second argument $throw is ignored and a - * > notice will be emitted if it is set to false. - * - * PHP version 8.0 - * - * @link https://github.com/php/php-src/blob/c0172aa2bdb9ea223c8491bdb300995b93a857a0/UPGRADING#L393-L395 - * - * @since 10.0.0 - */ -class RemovedSplAutoloadRegisterThrowFalseSniff extends AbstractFunctionCallParameterSniff -{ - - /** - * Functions to check for. - * - * @since 10.0.0 - * - * @var array - */ - protected $targetFunctions = [ - 'spl_autoload_register' => true, - ]; - - /** - * Do a version check to determine if this sniff needs to run at all. - * - * @since 10.0.0 - * - * @return bool - */ - protected function bowOutEarly() - { - return ($this->supportsAbove('8.0') === false); - } - - /** - * Process the parameters of a matched function. - * - * @since 10.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack. - * @param string $functionName The token content (function name) which was matched. - * @param array $parameters Array with information about the parameters. - * - * @return int|void Integer stack pointer to skip forward or void to continue - * normal file processing. - */ - public function processParameters(File $phpcsFile, $stackPtr, $functionName, $parameters) - { - $targetParam = PassedParameters::getParameterFromStack($parameters, 2, 'throw'); - if ($targetParam === false) { - return; - } - - if ($targetParam['clean'] !== 'false') { - return; - } - - $phpcsFile->addWarning( - 'Explicitly passing "false" as the value for $throw to spl_autoload_register() is deprecated since PHP 8.0.', - $targetParam['start'], - 'Deprecated' - ); - } -} diff --git a/PHPCompatibility/Sniffs/TextStrings/RemovedDollarBraceStringEmbedsSniff.php b/PHPCompatibility/Sniffs/TextStrings/RemovedDollarBraceStringEmbedsSniff.php deleted file mode 100644 index 468ebed1..00000000 --- a/PHPCompatibility/Sniffs/TextStrings/RemovedDollarBraceStringEmbedsSniff.php +++ /dev/null @@ -1,134 +0,0 @@ - PHP allows embedding variables in strings with double-quotes (") and heredoc in various ways. - * > 1. Directly embedding variables (`$foo`) - * > 2. Braces outside the variable (`{$foo}`) - * > 3. Braces after the dollar sign (`${foo}`) - * > 4. Variable variables (`${expr}`, equivalent to `(string) ${expr}`) - * > - * > [...] to deprecate options 3 and 4 in PHP 8.2 and remove them in PHP 9.0. - * - * PHP version 8.2 - * PHP version 9.0 - * - * @link https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation - * - * @since 10.0.0 - */ -class RemovedDollarBraceStringEmbedsSniff extends Sniff -{ - - /** - * Returns an array of tokens this test wants to listen for. - * - * @since 10.0.0 - * - * @return array - */ - public function register() - { - return [ - \T_DOUBLE_QUOTED_STRING, - \T_START_HEREDOC, - \T_DOLLAR_OPEN_CURLY_BRACES, - ]; - } - - /** - * Processes this test, when one of its tokens is encountered. - * - * @since 10.0.0 - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void|int Void or a stack pointer to skip forward. - */ - public function process(File $phpcsFile, $stackPtr) - { - if ($this->supportsAbove('8.2') === false) { - return; - } - - $tokens = $phpcsFile->getTokens(); - - /* - * Defensive coding, this code is not expected to ever actually be hit since PHPCS#3604 - * (included in 3.7.0), but _will_ be hit if a file containing a PHP 7.3 indented heredoc/nowdocs - * is scanned with PHPCS on PHP < 7.3. People shouldn't do that, but hey, we can't stop them. - */ - if ($tokens[$stackPtr]['code'] === \T_DOLLAR_OPEN_CURLY_BRACES) { - // @codeCoverageIgnoreStart - if ($tokens[($stackPtr - 1)]['code'] === \T_DOUBLE_QUOTED_STRING) { - --$stackPtr; - } else { - // Throw an error anyway, though it won't be very informative. - $message = 'Using ${} in strings is deprecated since PHP 8.2, use {$var} or {${expr}} instead.'; - $code = 'DeprecatedDollarBraceEmbed'; - $phpcsFile->addWarning($message, $stackPtr, $code); - return; - } - // @codeCoverageIgnoreEnd - } - - $endOfString = TextStrings::getEndOfCompleteTextString($phpcsFile, $stackPtr); - $startOfString = $stackPtr; - if ($tokens[$stackPtr]['code'] === \T_START_HEREDOC) { - $startOfString = ($stackPtr + 1); - } - - $contents = GetTokensAsString::normal($phpcsFile, $startOfString, $endOfString); - if (\strpos($contents, '${') === false) { - // No interpolation found or only interpolations which are still supported. - return ($endOfString + 1); - } - - $embeds = TextStrings::getEmbeds($contents); - foreach ($embeds as $offset => $embed) { - if (\strpos($embed, '${') !== 0) { - continue; - } - - // Figure out the stack pointer to throw the warning on. - $errorPtr = $startOfString; - $length = 0; - while (($length + $tokens[$errorPtr]['length']) < $offset) { - $length += $tokens[$errorPtr]['length']; - ++$errorPtr; - } - - // Type 4. - $message = 'Using %s (variable variables) in strings is deprecated since PHP 8.2, use {${expr}} instead.'; - $code = 'DeprecatedExpressionSyntax'; - if (\preg_match('`^\$\{(?P[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]+)(?:\[([\'"])?[^\$\{\}\]]+(?:\2)?\])?\}$`', $embed) === 1) { - // Type 3. - $message = 'Using ${var} in strings is deprecated since PHP 8.2, use {$var} instead. Found: %s'; - $code = 'DeprecatedVariableSyntax'; - } - - $phpcsFile->addWarning($message, $errorPtr, $code, [$embed]); - - } - - return ($endOfString + 1); - } -} diff --git a/PHPCompatibility/Tests/BaseSniffTest.php b/PHPCompatibility/Tests/BaseSniffTest.php deleted file mode 100644 index 68c9d605..00000000 --- a/PHPCompatibility/Tests/BaseSniffTest.php +++ /dev/null @@ -1,380 +0,0 @@ - 3) - * - * @since 10.0.0 - * - * @var \PHP_CodeSniffer\Config - */ - public static $lastConfig = null; - - /** - * Reset the sniff file cache before/after each test class. - * - * @beforeClass - * @afterClass - * - * @since 7.0.4 - * @since 10.0.0 Renamed the method from `setUpBeforeClass()` to `resetSniffFiles()` and - * now using the `@beforeClass`/`@afterClass` annotations to allow for - * PHPUnit cross-version compatibility. - * - * @return void - */ - public static function resetSniffFiles() - { - self::$sniffFiles = []; - } - - /** - * Reset the testVersion after each test. - * - * @after - * - * @since 5.5 - * @since 10.0.0 Renamed the method from `tearDown()` to `resetTestVersion()` and now using - * the `@after` annotation to allow for PHPUnit cross-version compatibility. - * - * @return void - */ - public function resetTestVersion() - { - // Reset the targetPhpVersion. - Helper::setConfigData('testVersion', null, true, self::$lastConfig); - } - - /** - * Get the sniff code for the current sniff being tested. - * - * @since 7.1.3 - * - * @return string - */ - protected function getSniffCode() - { - $class = \get_class($this); - $parts = \explode('\\', $class); - $sniff = \array_pop($parts); - $sniff = \str_replace('UnitTest', '', $sniff); - $category = \array_pop($parts); - return self::STANDARD_NAME . '.' . $category . '.' . $sniff; - } - - /** - * Sniff a file and return resulting file object. - * - * @since 5.5 - * @since 9.0.0 Signature change. The `$filename` parameter was renamed to - * `$pathToFile` and now expects an absolute path instead of - * a relative one. - * - * @param string $pathToFile Absolute path to the file to sniff. - * Allows for passing __FILE__ from the unit test - * file. In that case, the test case file is presumed - * to have the same name, but with an `inc` extension. - * @param string $targetPhpVersion Value of 'testVersion' to set on PHPCS object. - * - * @return \PHP_CodeSniffer\Files\File|false File object. - */ - public function sniffFile($pathToFile, $targetPhpVersion = 'none') - { - if (\strpos($pathToFile, 'UnitTest.php') !== false) { - // Ok, so __FILE__ was passed, change the file extension. - $pathToFile = \str_replace('UnitTest.php', 'UnitTest.inc', $pathToFile); - } - $pathToFile = \realpath($pathToFile); - - if (isset(self::$sniffFiles[$pathToFile][$targetPhpVersion])) { - return self::$sniffFiles[$pathToFile][$targetPhpVersion]; - } - - // Set up the Config and tokenize the test case file only once. - if (isset(self::$sniffFiles[$pathToFile]['only_parsed']) === false) { - try { - // PHPCS 3.x, 4.x. - $config = new \PHP_CodeSniffer\Config(); - $config->cache = false; - $config->standards = [self::STANDARD_NAME]; - $config->sniffs = [$this->getSniffCode()]; - $config->ignored = []; - - self::$lastConfig = $config; - - $ruleset = new \PHP_CodeSniffer\Ruleset($config); - - self::$sniffFiles[$pathToFile]['only_parsed'] = new \PHP_CodeSniffer\Files\LocalFile($pathToFile, $ruleset, $config); - self::$sniffFiles[$pathToFile]['only_parsed']->parse(); - } catch (\Exception $e) { - $this->fail('An unexpected exception has been caught when parsing file "' . $pathToFile . '" : ' . $e->getMessage()); - return false; - } - } - - // Now process the file against the target testVersion setting and cache the results. - self::$sniffFiles[$pathToFile][$targetPhpVersion] = clone self::$sniffFiles[$pathToFile]['only_parsed']; - - if ($targetPhpVersion !== 'none') { - Helper::setConfigData('testVersion', $targetPhpVersion, true, self::$sniffFiles[$pathToFile][$targetPhpVersion]->config); - } - - try { - self::$sniffFiles[$pathToFile][$targetPhpVersion]->process(); - } catch (\Exception $e) { - $this->fail('An unexpected exception has been caught when processing file "' . $pathToFile . '" : ' . $e->getMessage()); - return false; - } - - return self::$sniffFiles[$pathToFile][$targetPhpVersion]; - } - - /** - * Assert a PHPCS error on a particular line number. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer\Files\File $file Codesniffer file object. - * @param int $lineNumber Line number. - * @param string $expectedMessage Expected error message (assertContains). - * - * @return bool - */ - public function assertError(File $file, $lineNumber, $expectedMessage) - { - $errors = $this->gatherErrors($file); - - return $this->assertForType($errors, 'error', $lineNumber, $expectedMessage); - } - - /** - * Assert a PHPCS warning on a particular line number. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer\Files\File $file Codesniffer file object. - * @param int $lineNumber Line number. - * @param string $expectedMessage Expected message (assertContains). - * - * @return bool - */ - public function assertWarning(File $file, $lineNumber, $expectedMessage) - { - $warnings = $this->gatherWarnings($file); - - return $this->assertForType($warnings, 'warning', $lineNumber, $expectedMessage); - } - - /** - * Assert a PHPCS error or warning on a particular line number. - * - * @since 7.0.3 - * - * @param array $issues Array of issues of a particular type. - * @param string $type The type of issues, either 'error' or 'warning'. - * @param int $lineNumber Line number. - * @param string $expectedMessage Expected message (assertContains). - * - * @return bool - * - * @throws \Exception When no issues of a certain type where found on a line - * for which issues of that type where expected. - */ - private function assertForType($issues, $type, $lineNumber, $expectedMessage) - { - if (isset($issues[$lineNumber]) === false) { - $this->fail("Expected $type '$expectedMessage' on line number $lineNumber, but none found."); - } - - $insteadFoundMessages = []; - - // Concat any error messages so we can do an assertContains. - foreach ($issues[$lineNumber] as $issue) { - $insteadFoundMessages[] = $issue['message']; - } - - $insteadMessagesString = \implode(', ', $insteadFoundMessages); - - $msg = "Expected $type message '$expectedMessage' on line $lineNumber not found. Instead found: $insteadMessagesString."; - - return $this->assertStringContainsString($expectedMessage, $insteadMessagesString, $msg); - } - - /** - * Assert no violation (warning or error) on a given line number. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer\Files\File $file Codesniffer File object. - * @param mixed $lineNumber Line number. - * - * @return bool - */ - public function assertNoViolation(File $file, $lineNumber = 0) - { - $errors = $this->gatherErrors($file); - $warnings = $this->gatherWarnings($file); - - if (empty($errors) && empty($warnings)) { - return $this->assertTrue(true); - } - - if ($lineNumber === 0) { - $failMessage = 'Failed asserting no violations in file. Found ' . \count($errors) . ' errors and ' . \count($warnings) . ' warnings.'; - $allMessages = $errors + $warnings; - // TODO: Update the fail message to give the tester some - // indication of what the errors or warnings were. - return $this->assertEmpty($allMessages, $failMessage); - } - - $encounteredMessages = []; - if (isset($errors[$lineNumber])) { - foreach ($errors[$lineNumber] as $error) { - $encounteredMessages[] = 'ERROR: ' . $error['message']; - } - } - - if (isset($warnings[$lineNumber])) { - foreach ($warnings[$lineNumber] as $warning) { - $encounteredMessages[] = 'WARNING: ' . $warning['message']; - } - } - - $failMessage = "Failed asserting no standards violation on line $lineNumber. Found: \n" - . \implode("\n", $encounteredMessages); - $this->assertCount(0, $encounteredMessages, $failMessage); - } - - /** - * Show violations in file by line number. - * - * This is useful for debugging sniffs on a file. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer\Files\File $file Codesniffer file object. - * - * @return array - */ - public function showViolations(File $file) - { - $violations = [ - 'errors' => $this->gatherErrors($file), - 'warnings' => $this->gatherWarnings($file), - ]; - - return $violations; - } - - /** - * Gather all error messages by line number from phpcs file result. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer\Files\File $file Codesniffer File object. - * - * @return array - */ - public function gatherErrors(File $file) - { - $foundErrors = $file->getErrors(); - - return $this->gatherIssues($foundErrors); - } - - /** - * Gather all warning messages by line number from phpcs file result. - * - * @since 5.5 - * - * @param \PHP_CodeSniffer\Files\File $file Codesniffer File object. - * - * @return array - */ - public function gatherWarnings(File $file) - { - $foundWarnings = $file->getWarnings(); - - return $this->gatherIssues($foundWarnings); - } - - /** - * Gather all messages or a particular type by line number. - * - * @since 7.0.3 - * - * @param array $issuesArray Array of a particular type of issues, - * i.e. errors or warnings. - * - * @return array - */ - private function gatherIssues($issuesArray) - { - $allIssues = []; - foreach ($issuesArray as $line => $lineIssues) { - foreach ($lineIssues as $column => $issues) { - foreach ($issues as $issue) { - - if (isset($allIssues[$line]) === false) { - $allIssues[$line] = []; - } - - $allIssues[$line][] = $issue; - } - } - } - - return $allIssues; - } -} diff --git a/PHPCompatibility/Tests/FunctionDeclarations/ForbiddenFinalPrivateMethodsUnitTest.inc b/PHPCompatibility/Tests/FunctionDeclarations/ForbiddenFinalPrivateMethodsUnitTest.inc deleted file mode 100644 index b8acbecd..00000000 --- a/PHPCompatibility/Tests/FunctionDeclarations/ForbiddenFinalPrivateMethodsUnitTest.inc +++ /dev/null @@ -1,61 +0,0 @@ - function() { exit; }, // Ignore, nested closed scope. - ]; - - $anon = new class { - function something() { - exit; // Ignore, nested closed scope. - } - }; - - $array = array( - 'closure' => function() { exit; }, // Ignore, nested closed scope. - ); - - die; // Error. - } - - /** - * This should be easily skipped over. - */ - abstract function something(); - #[AttributeWhichCouldBeLong, ShouldBeSkippedOver( 10, self::CONST_VALUE)] - public function __DeStruct() { - // Destructor will not be called on exit() in constructor. - } -} - -trait CrossVersionInValid -{ - public function __construct() { - exit(1); // Error. - } - - public function __destruct() { - // Destructor will not be called on exit() in constructor. - } -} - -class DoesntExtendAndDoesntHaveDestructMethodButUsesTrait { - use TraitWhichMayOrMayNotContainADestructMethod; - - public function __construct() { - die(1); // Warning. - } -} - -/* - * Prevent false positives. - */ -class DoesntExtendAndDoesntHaveDestructMethod { - public function __construct() { - exit(1); - } -} - -trait CantExtendAndDoesntHaveDestructMethod { - public function __construct() { - exit(1); - } -} - -class ExitNotInFunctionScope { - public function __construct() { - $this->property = function($param) { - exit(1); - }; - } - - public function __destruct() {} -} - -function __construct() {} - -interface DoesntHaveCodeInFunctions { - public function __construct(); -} diff --git a/PHPCompatibility/Tests/FunctionDeclarations/RemovedCallingDestructAfterConstructorExitUnitTest.php b/PHPCompatibility/Tests/FunctionDeclarations/RemovedCallingDestructAfterConstructorExitUnitTest.php deleted file mode 100644 index 43d1bd0b..00000000 --- a/PHPCompatibility/Tests/FunctionDeclarations/RemovedCallingDestructAfterConstructorExitUnitTest.php +++ /dev/null @@ -1,123 +0,0 @@ -sniffFile(__FILE__, '8.0'); - $error = "When $name() is called within an object constructor, the object destructor will no longer be called since PHP 8.0"; - - if ($isError === true) { - $this->assertError($file, $line, $error); - } else { - $this->assertWarning($file, $line, $error); - } - } - - /** - * Data provider. - * - * @see testRemovedCallingDestructAfterConstructorExit() - * - * @return array - */ - public function dataRemovedCallingDestructAfterConstructorExit() - { - return [ - [33, 'exit'], - [44, 'die', false], - [46, 'exit', false], - [69, 'die'], - [85, 'exit'], - [97, 'die', false], - ]; - } - - - /** - * Verify the sniff does not throw false positives for valid code. - * - * @dataProvider dataNoFalsePositives - * - * @param int $line The line number. - * - * @return void - */ - public function testNoFalsePositives($line) - { - $file = $this->sniffFile(__FILE__, '8.0'); - $this->assertNoViolation($file, $line); - } - - /** - * Data provider. - * - * @see testNoFalsePositives() - * - * @return array - */ - public function dataNoFalsePositives() - { - $cases = []; - // No errors expected on the first 26 lines. - for ($line = 1; $line <= 26; $line++) { - $cases[] = [$line]; - } - - $cases[] = [56]; - $cases[] = [61]; - $cases[] = [66]; - - for ($line = 101; $line <= 130; $line++) { - $cases[] = [$line]; - } - - return $cases; - } - - - /** - * Verify no notices are thrown at all. - * - * @return void - */ - public function testNoViolationsInFileOnValidVersion() - { - $file = $this->sniffFile(__FILE__, '7.4'); - $this->assertNoViolation($file); - } -} diff --git a/PHPCompatibility/Tests/FunctionDeclarations/RemovedOptionalBeforeRequiredParamUnitTest.inc b/PHPCompatibility/Tests/FunctionDeclarations/RemovedOptionalBeforeRequiredParamUnitTest.inc deleted file mode 100644 index 4cd62436..00000000 --- a/PHPCompatibility/Tests/FunctionDeclarations/RemovedOptionalBeforeRequiredParamUnitTest.inc +++ /dev/null @@ -1,51 +0,0 @@ - $a ? (string) $b : ''; - -// Parse error, nothing in default, not our concern. Throw error anyway. -$closure = function ($a = /*comment*/, $b) {}; - -// Prevent false positives on variadic parameters. -function variadicIsOptionalByNature($a, int ...$b) {} -function variadicIsOptionalByNatureWithExtraOptional($a, $b = null, ...$c) {} -// Intentional parse error. This has always been an error though, so ignore for this sniff. -function variadicBeforeRequiredWasAlwaysAnError(...$a, $b) {} - -// Rule also applies to constructor property promotion. -class ConstructorPropertyPromotion { - public function __construct( - public $propA = 10, - protected $propB, - ) {} -} - -class MixedWithOptionalProperty { - public function __construct( - public $propA = false, - $normalParam - ) {} -} - -class MixedWithOptionalParam { - public function __construct( - public $propA, - $normalParam = 10, // OK. - ) {} -} - -// Intentional parse error. This has to be the last test in the file. -$closure = function( $a = [], $b diff --git a/PHPCompatibility/Tests/FunctionDeclarations/RemovedOptionalBeforeRequiredParamUnitTest.php b/PHPCompatibility/Tests/FunctionDeclarations/RemovedOptionalBeforeRequiredParamUnitTest.php deleted file mode 100644 index af0e9063..00000000 --- a/PHPCompatibility/Tests/FunctionDeclarations/RemovedOptionalBeforeRequiredParamUnitTest.php +++ /dev/null @@ -1,119 +0,0 @@ -sniffFile(__FILE__, '8.0'); - $this->assertWarning($file, $line, 'Declaring a required parameter after an optional one is deprecated since PHP 8.0'); - } - - /** - * Data provider. - * - * @see testRemovedOptionalBeforeRequiredParam() - * - * @return array - */ - public function dataRemovedOptionalBeforeRequiredParam() - { - return [ - [13], // Warning x 2. - [14], - [16], - [17], - [20], - [32], - [39], - ]; - } - - - /** - * Verify the sniff does not throw false positives for valid code. - * - * @dataProvider dataNoFalsePositives - * - * @param int $line The line number. - * - * @return void - */ - public function testNoFalsePositives($line) - { - $file = $this->sniffFile(__FILE__, '8.0'); - $this->assertNoViolation($file, $line); - } - - /** - * Data provider. - * - * @see testNoFalsePositives() - * - * @return array - */ - public function dataNoFalsePositives() - { - $cases = []; - // No errors expected on the first 9 lines. - for ($line = 1; $line <= 9; $line++) { - $cases[] = [$line]; - } - - // Don't error on variadic parameters. - $cases[] = [23]; - $cases[] = [24]; - $cases[] = [26]; - - // Constructor property promotion - valid example. - $cases[] = [46]; - - // Add parse error test case. - $cases[] = [51]; - - return $cases; - } - - - /** - * Verify no notices are thrown at all. - * - * @return void - */ - public function testNoViolationsInFileOnValidVersion() - { - $file = $this->sniffFile(__FILE__, '7.4'); - $this->assertNoViolation($file); - } -} diff --git a/PHPCompatibility/Tests/FunctionUse/RemovedFunctionsUnitTest.inc b/PHPCompatibility/Tests/FunctionUse/RemovedFunctionsUnitTest.inc deleted file mode 100644 index ae484c99..00000000 --- a/PHPCompatibility/Tests/FunctionUse/RemovedFunctionsUnitTest.inc +++ /dev/null @@ -1,1232 +0,0 @@ -php_check_syntax(); -MyClass::php_check_syntax(); -MyNamespace\php_check_syntax(); -echo PHP_CHECK_SYNTAX; // Constant. -const php_check_syntax = 'abc'; -use php_check_syntax; -function php_check_syntax() {} -abstract class Split {} - -// More deprecated functions, PHP 7.2 -jpeg2wbmp(); -png2wbmp(); -create_function(); -while (list($key, $val) = each($array)) {} -gmp_random(2); -read_exif_data(); - -// PHP 7.3. -image2wbmp(); -mbregex_encoding(); -mbereg(); -mberegi(); -mbereg_replace(); -mberegi_replace(); -mbsplit(); -mbereg_match(); -mbereg_search(); -mbereg_search_pos(); -mbereg_search_regs(); -mbereg_search_init(); -mbereg_search_getregs(); -mbereg_search_getpos(); -mbereg_search_setpos(); -fgetss(); -gzgetss(); - -// PHP 7.4. -ibase_add_user(); -ibase_affected_rows(); -ibase_backup(); -ibase_blob_add(); -ibase_blob_cancel(); -ibase_blob_close(); -ibase_blob_create(); -ibase_blob_echo(); -ibase_blob_get(); -ibase_blob_import(); -ibase_blob_info(); -ibase_blob_open(); -ibase_close(); -ibase_commit_ret(); -ibase_commit(); -ibase_connect(); -ibase_db_info(); -ibase_delete_user(); -ibase_drop_db(); -ibase_errcode(); -ibase_errmsg(); -ibase_execute(); -ibase_fetch_assoc(); -ibase_fetch_object(); -ibase_fetch_row(); -ibase_field_info(); -ibase_free_event_handler(); -ibase_free_query(); -ibase_free_result(); -ibase_gen_id(); -ibase_maintain_db(); -ibase_modify_user(); -ibase_name_result(); -ibase_num_fields(); -ibase_num_params(); -ibase_param_info(); -ibase_pconnect(); -ibase_prepare(); -ibase_query(); -ibase_restore(); -ibase_rollback_ret(); -ibase_rollback(); -ibase_server_info(); -ibase_service_attach(); -ibase_service_detach(); -ibase_set_event_handler(); -ibase_trans(); -ibase_wait_event(); - -// Pfpro extension - PHP 5.1 -pfpro_cleanup(); -pfpro_init(); -pfpro_process_raw(); -pfpro_process(); -pfpro_version(); - -// PHP 7.4. -wddx_add_vars(); -wddx_deserialize(); -wddx_packet_end(); -wddx_packet_start(); -wddx_serialize_value(); -wddx_serialize_vars(); -ldap_control_paged_result_response(); -ldap_control_paged_result(); -recode_file(); -recode_string(); -recode(); -is_real(); -get_magic_quotes_gpc(); -get_magic_quotes_runtime(); -hebrevc($str)); -convert_cyr_string($str, 'k', 'i'); -money_format(); -ezmlm_hash(); -restore_include_path(); - -// These calls should *not* trigger an error. -$myobject -> php_check_syntax (); // Method, not the native PHP function. -myNamespace \ /*comment*/ php_check_syntax(); // Namespaced function, not the native PHP function. -namespace\php_check_syntax(); // Namespaced function, not the native PHP function. -$obj = new php_check_syntax /*comment*/ (); // Class not method. - -// PHP 5.3 Ncurses extension. -ncurses_addch(); -ncurses_addchnstr(); -ncurses_addchstr(); -ncurses_addnstr(); -ncurses_addstr(); -ncurses_assume_default_colors(); -ncurses_attroff(); -ncurses_attron(); -ncurses_attrset(); -ncurses_baudrate(); -ncurses_beep(); -ncurses_bkgd(); -ncurses_bkgdset(); -ncurses_border(); -ncurses_bottom_panel(); -ncurses_can_change_color(); -ncurses_cbreak(); -ncurses_clear(); -ncurses_clrtobot(); -ncurses_clrtoeol(); -ncurses_color_content(); -ncurses_color_set(); -ncurses_curs_set(); -ncurses_def_prog_mode(); -ncurses_def_shell_mode(); -ncurses_define_key(); -ncurses_del_panel(); -ncurses_delay_output(); -ncurses_delch(); -ncurses_deleteln(); -ncurses_delwin(); -ncurses_doupdate(); -ncurses_echo(); -ncurses_echochar(); -ncurses_end(); -ncurses_erase(); -ncurses_erasechar(); -ncurses_filter(); -ncurses_flash(); -ncurses_flushinp(); -ncurses_getch(); -ncurses_getmaxyx(); -ncurses_getmouse(); -ncurses_getyx(); -ncurses_halfdelay(); -ncurses_has_colors(); -ncurses_has_ic(); -ncurses_has_il(); -ncurses_has_key(); -ncurses_hide_panel(); -ncurses_hline(); -ncurses_inch(); -ncurses_init_color(); -ncurses_init_pair(); -ncurses_init(); -ncurses_insch(); -ncurses_insdelln(); -ncurses_insertln(); -ncurses_insstr(); -ncurses_instr(); -ncurses_isendwin(); -ncurses_keyok(); -ncurses_keypad(); -ncurses_killchar(); -ncurses_longname(); -ncurses_meta(); -ncurses_mouse_trafo(); -ncurses_mouseinterval(); -ncurses_mousemask(); -ncurses_move_panel(); -ncurses_move(); -ncurses_mvaddch(); -ncurses_mvaddchnstr(); -ncurses_mvaddchstr(); -ncurses_mvaddnstr(); -ncurses_mvaddstr(); -ncurses_mvcur(); -ncurses_mvdelch(); -ncurses_mvgetch(); -ncurses_mvhline(); -ncurses_mvinch(); -ncurses_mvvline(); -ncurses_mvwaddstr(); -ncurses_napms(); -ncurses_new_panel(); -ncurses_newpad(); -ncurses_newwin(); -ncurses_nl(); -ncurses_nocbreak(); -ncurses_noecho(); -ncurses_nonl(); -ncurses_noqiflush(); -ncurses_noraw(); -ncurses_pair_content(); -ncurses_panel_above(); -ncurses_panel_below(); -ncurses_panel_window(); -ncurses_pnoutrefresh(); -ncurses_prefresh(); -ncurses_putp(); -ncurses_qiflush(); -ncurses_raw(); -ncurses_refresh(); -ncurses_replace_panel(); -ncurses_reset_prog_mode(); -ncurses_reset_shell_mode(); -ncurses_resetty(); -ncurses_savetty(); -ncurses_scr_dump(); -ncurses_scr_init(); -ncurses_scr_restore(); -ncurses_scr_set(); -ncurses_scrl(); -ncurses_show_panel(); -ncurses_slk_attr(); -ncurses_slk_attroff(); -ncurses_slk_attron(); -ncurses_slk_attrset(); -ncurses_slk_clear(); -ncurses_slk_color(); -ncurses_slk_init(); -ncurses_slk_noutrefresh(); -ncurses_slk_refresh(); -ncurses_slk_restore(); -ncurses_slk_set(); -ncurses_slk_touch(); -ncurses_standend(); -ncurses_standout(); -ncurses_start_color(); -ncurses_termattrs(); -ncurses_termname(); -ncurses_timeout(); -ncurses_top_panel(); -ncurses_typeahead(); -ncurses_ungetch(); -ncurses_ungetmouse(); -ncurses_update_panels(); -ncurses_use_default_colors(); -ncurses_use_env(); -ncurses_use_extended_names(); -ncurses_vidattr(); -ncurses_vline(); -ncurses_waddch(); -ncurses_waddstr(); -ncurses_wattroff(); -ncurses_wattron(); -ncurses_wattrset(); -ncurses_wborder(); -ncurses_wclear(); -ncurses_wcolor_set(); -ncurses_werase(); -ncurses_wgetch(); -ncurses_whline(); -ncurses_wmouse_trafo(); -ncurses_wmove(); -ncurses_wnoutrefresh(); -ncurses_wrefresh(); -ncurses_wstandend(); -ncurses_wstandout(); -ncurses_wvline(); - -// PHP 5.1 MCVE extension. -m_checkstatus(); -m_completeauthorizations(); -m_connect(); -m_connectionerror(); -m_deletetrans(); -m_destroyconn(); -m_destroyengine(); -m_getcell(); -m_getcellbynum(); -m_getcommadelimited(); -m_getheader(); -m_initconn(); -m_initengine(); -m_iscommadelimited(); -m_maxconntimeout(); -m_monitor(); -m_numcolumns(); -m_numrows(); -m_parsecommadelimited(); -m_responsekeys(); -m_responseparam(); -m_returnstatus(); -m_setblocking(); -m_setdropfile(); -m_setip(); -m_setssl_cafile(); -m_setssl_files(); -m_setssl(); -m_settimeout(); -m_sslcert_gen_hash(); -m_transactionssent(); -m_transinqueue(); -m_transkeyval(); -m_transnew(); -m_transsend(); -m_uwait(); -m_validateidentifier(); -m_verifyconnection(); -m_verifysslcert(); - -// PHP 5.1 DIO extension. -dio_close(); -dio_fcntl(); -dio_open(); -dio_read(); -dio_seek(); -dio_stat(); -dio_tcsetattr(); -dio_truncate(); -dio_write(); - -// PHP 5.3 FDF extension. -fdf_add_doc_javascript(); -fdf_add_template(); -fdf_close(); -fdf_create(); -fdf_enum_values(); -fdf_errno(); -fdf_error(); -fdf_get_ap(); -fdf_get_attachment(); -fdf_get_encoding(); -fdf_get_file(); -fdf_get_flags(); -fdf_get_opt(); -fdf_get_status(); -fdf_get_value(); -fdf_get_version(); -fdf_header(); -fdf_next_field_name(); -fdf_open_string(); -fdf_open(); -fdf_remove_item(); -fdf_save_string(); -fdf_save(); -fdf_set_ap(); -fdf_set_encoding(); -fdf_set_file(); -fdf_set_flags(); -fdf_set_javascript_action(); -fdf_set_on_import_javascript(); -fdf_set_opt(); -fdf_set_status(); -fdf_set_submit_form_action(); -fdf_set_target_frame(); -fdf_set_value(); -fdf_set_version(); - -// PHP 5.3 Ming extension. -ming_keypress(); -ming_setcubicthreshold(); -ming_setscale(); -ming_setswfcompression(); -ming_useconstants(); -ming_useswfversion(); - -// PHP 5.1 Fam extension. -fam_cancel_monitor(); -fam_close(); -fam_monitor_collection(); -fam_monitor_directory(); -fam_monitor_file(); -fam_next_event(); -fam_open(); -fam_pending(); -fam_resume_monitor(); -fam_suspend_monitor(); - -// PHP 5.2 HWAPI extension. -hwapi_attribute_new(); -hwapi_content_new(); -hwapi_hgcsp(); -hwapi_object_new(); - -// PHP 5.1 YP/NIS extension. -yp_all(); -yp_cat(); -yp_err_string(); -yp_errno(); -yp_first(); -yp_get_default_domain(); -yp_master(); -yp_match(); -yp_next(); -yp_order(); - -// PHP 5.1 Mnogosearch extension. -udm_add_search_limit(); -udm_alloc_agent_array(); -udm_alloc_agent(); -udm_api_version(); -udm_cat_list(); -udm_cat_path(); -udm_check_charset(); -udm_clear_search_limits(); -udm_crc32(); -udm_errno(); -udm_error(); -udm_find(); -udm_free_agent(); -udm_free_ispell_data(); -udm_free_res(); -udm_get_doc_count(); -udm_get_res_field(); -udm_get_res_param(); -udm_hash32(); -udm_load_ispell_data(); -udm_set_agent_param(); - -// PHP 5.1.3 Msession extension. -msession_connect(); -msession_count(); -msession_create(); -msession_destroy(); -msession_disconnect(); -msession_find(); -msession_get_array(); -msession_get_data(); -msession_get(); -msession_inc(); -msession_list(); -msession_listvar(); -msession_lock(); -msession_plugin(); -msession_randstr(); -msession_set_array(); -msession_set_data(); -msession_set(); -msession_timeout(); -msession_uniq(); -msession_unlock(); - -__autoload($class); - -// PHP 5.0 Crack extension. -crack_check(); -crack_closedict(); -crack_getlastmessage(); -crack_opendict(); - -// PHP 5.1 W32API extension. -w32api_deftype(); -w32api_init_dtype(); -w32api_invoke_function(); -w32api_register_function(); -w32api_set_call_method(); - -// PHP 5.1 CPDF extension. -cpdf_add_annotation(); -cpdf_add_outline(); -cpdf_arc(); -cpdf_begin_text(); -cpdf_circle(); -cpdf_clip(); -cpdf_close(); -cpdf_closepath_fill_stroke(); -cpdf_closepath_stroke(); -cpdf_closepath(); -cpdf_continue_text(); -cpdf_curveto(); -cpdf_end_text(); -cpdf_fill_stroke(); -cpdf_fill(); -cpdf_finalize_page(); -cpdf_finalize(); -cpdf_global_set_document_limits(); -cpdf_import_jpeg(); -cpdf_lineto(); -cpdf_moveto(); -cpdf_newpath(); -cpdf_open(); -cpdf_output_buffer(); -cpdf_page_init(); -cpdf_place_inline_image(); -cpdf_rect(); -cpdf_restore(); -cpdf_rlineto(); -cpdf_rmoveto(); -cpdf_rotate_text(); -cpdf_rotate(); -cpdf_save_to_file(); -cpdf_save(); -cpdf_scale(); -cpdf_set_action_url(); -cpdf_set_char_spacing(); -cpdf_set_creator(); -cpdf_set_current_page(); -cpdf_set_font_directories(); -cpdf_set_font_map_file(); -cpdf_set_font(); -cpdf_set_horiz_scaling(); -cpdf_set_keywords(); -cpdf_set_leading(); -cpdf_set_page_animation(); -cpdf_set_subject(); -cpdf_set_text_matrix(); -cpdf_set_text_pos(); -cpdf_set_text_rendering(); -cpdf_set_text_rise(); -cpdf_set_title(); -cpdf_set_viewer_preferences(); -cpdf_set_word_spacing(); -cpdf_setdash(); -cpdf_setflat(); -cpdf_setgray_fill(); -cpdf_setgray_stroke(); -cpdf_setgray(); -cpdf_setlinecap(); -cpdf_setlinejoin(); -cpdf_setlinewidth(); -cpdf_setmiterlimit(); -cpdf_setrgbcolor_fill(); -cpdf_setrgbcolor_stroke(); -cpdf_setrgbcolor(); -cpdf_show_xy(); -cpdf_show(); -cpdf_stringwidth(); -cpdf_stroke(); -cpdf_text(); -cpdf_translate(); -ircg_channel_mode(); -ircg_disconnect(); -ircg_eval_ecmascript_params(); -ircg_fetch_error_msg(); -ircg_get_username(); -ircg_html_encode(); -ircg_ignore_add(); -ircg_ignore_del(); -ircg_invite(); -ircg_is_conn_alive(); -ircg_join(); -ircg_kick(); -ircg_list(); -ircg_lookup_format_messages(); -ircg_lusers(); -ircg_msg(); -ircg_names(); -ircg_nick(); -ircg_nickname_escape(); -ircg_nickname_unescape(); -ircg_notice(); -ircg_oper(); -ircg_part(); -ircg_pconnect(); -ircg_register_format_messages(); -ircg_set_current(); -ircg_set_file(); -ircg_set_on_die(); -ircg_topic(); -ircg_who(); -ircg_whois(); -dbase_add_record(); -dbase_close(); -dbase_create(); -dbase_delete_record(); -dbase_get_header_info(); -dbase_get_record_with_names(); -dbase_get_record(); -dbase_numfields(); -dbase_numrecords(); -dbase_open(); -dbase_pack(); -dbase_replace_record(); -dbx_close(); -dbx_compare(); -dbx_connect(); -dbx_error(); -dbx_escape_string(); -dbx_fetch_row(); -dbx_query(); -dbx_sort(); -fbsql_affected_rows(); -fbsql_autocommit(); -fbsql_blob_size(); -fbsql_change_user(); -fbsql_clob_size(); -fbsql_close(); -fbsql_commit(); -fbsql_connect(); -fbsql_create_blob(); -fbsql_create_clob(); -fbsql_create_db(); -fbsql_data_seek(); -fbsql_database_password(); -fbsql_database(); -fbsql_db_query(); -fbsql_db_status(); -fbsql_drop_db(); -fbsql_errno(); -fbsql_error(); -fbsql_fetch_array(); -fbsql_fetch_assoc(); -fbsql_fetch_field(); -fbsql_fetch_lengths(); -fbsql_fetch_object(); -fbsql_fetch_row(); -fbsql_field_flags(); -fbsql_field_len(); -fbsql_field_name(); -fbsql_field_seek(); -fbsql_field_table(); -fbsql_field_type(); -fbsql_free_result(); -fbsql_get_autostart_info(); -fbsql_hostname(); -fbsql_insert_id(); -fbsql_list_dbs(); -fbsql_list_fields(); -fbsql_list_tables(); -fbsql_next_result(); -fbsql_num_fields(); -fbsql_num_rows(); -fbsql_password(); -fbsql_pconnect(); -fbsql_query(); -fbsql_read_blob(); -fbsql_read_clob(); -fbsql_result(); -fbsql_rollback(); -fbsql_rows_fetched(); -fbsql_select_db(); -fbsql_set_characterset(); -fbsql_set_lob_mode(); -fbsql_set_password(); -fbsql_set_transaction(); -fbsql_start_db(); -fbsql_stop_db(); -fbsql_table_name(); -fbsql_tablename(); -fbsql_username(); -fbsql_warnings(); -filepro_fieldcount(); -filepro_fieldname(); -filepro_fieldtype(); -filepro_fieldwidth(); -filepro_retrieve(); -filepro_rowcount(); -filepro(); -ingres_autocommit(); -ingres_close(); -ingres_commit(); -ingres_connect(); -ingres_fetch_array(); -ingres_fetch_object(); -ingres_fetch_row(); -ingres_field_length(); -ingres_field_name(); -ingres_field_nullable(); -ingres_field_precision(); -ingres_field_scale(); -ingres_field_type(); -ingres_num_fields(); -ingres_num_rows(); -ingres_pconnect(); -ingres_query(); -ingres_rollback(); -msql_affected_rows(); -msql_close(); -msql_connect(); -msql_create_db(); -msql_createdb(); -msql_data_seek(); -msql_db_query(); -msql_dbname(); -msql_drop_db(); -msql_error(); -msql_fetch_array(); -msql_fetch_field(); -msql_fetch_object(); -msql_fetch_row(); -msql_field_flags(); -msql_field_len(); -msql_field_name(); -msql_field_seek(); -msql_field_table(); -msql_field_type(); -msql_fieldflags(); -msql_fieldlen(); -msql_fieldname(); -msql_fieldtable(); -msql_fieldtype(); -msql_free_result(); -msql_list_dbs(); -msql_list_fields(); -msql_list_tables(); -msql_num_fields(); -msql_num_rows(); -msql_numfields(); -msql_numrows(); -msql_pconnect(); -msql_query(); -msql_regcase(); -msql_result(); -msql_select_db(); -msql_tablename(); -msql(); -mssql_bind(); -mssql_close(); -mssql_connect(); -mssql_data_seek(); -mssql_execute(); -mssql_fetch_array(); -mssql_fetch_assoc(); -mssql_fetch_batch(); -mssql_fetch_field(); -mssql_fetch_object(); -mssql_fetch_row(); -mssql_field_length(); -mssql_field_name(); -mssql_field_seek(); -mssql_field_type(); -mssql_free_result(); -mssql_free_statement(); -mssql_get_last_message(); -mssql_guid_string(); -mssql_init(); -mssql_min_error_severity(); -mssql_min_message_severity(); -mssql_next_result(); -mssql_num_fields(); -mssql_num_rows(); -mssql_pconnect(); -mssql_query(); -mssql_result(); -mssql_rows_affected(); -mssql_select_db(); -sqlite_array_query(); -sqlite_busy_timeout(); -sqlite_changes(); -sqlite_close(); -sqlite_column(); -sqlite_create_aggregate(); -sqlite_create_function(); -sqlite_current(); -sqlite_error_string(); -sqlite_escape_string(); -sqlite_exec(); -sqlite_factory(); -sqlite_fetch_all(); -sqlite_fetch_array(); -sqlite_fetch_column_types(); -sqlite_fetch_object(); -sqlite_fetch_single(); -sqlite_fetch_string(); -sqlite_field_name(); -sqlite_has_more(); -sqlite_has_prev(); -sqlite_key(); -sqlite_last_error(); -sqlite_last_insert_rowid(); -sqlite_libencoding(); -sqlite_libversion(); -sqlite_next(); -sqlite_num_fields(); -sqlite_num_rows(); -sqlite_open(); -sqlite_popen(); -sqlite_prev(); -sqlite_query(); -sqlite_rewind(); -sqlite_seek(); -sqlite_single_query(); -sqlite_udf_decode_binary(); -sqlite_udf_encode_binary(); -sqlite_unbuffered_query(); -sqlite_valid(); -mysql_affected_rows(); -mysql_client_encoding(); -mysql_close(); -mysql_connect(); -mysql_create_db(); -mysql_data_seek(); -mysql_db_name(); -mysql_drop_db(); -mysql_errno(); -mysql_error(); -mysql_fetch_array(); -mysql_fetch_assoc(); -mysql_fetch_field(); -mysql_fetch_lengths(); -mysql_fetch_object(); -mysql_fetch_row(); -mysql_field_flags(); -mysql_field_len(); -mysql_field_name(); -mysql_field_seek(); -mysql_field_table(); -mysql_field_type(); -mysql_free_result(); -mysql_get_client_info(); -mysql_get_host_info(); -mysql_get_proto_info(); -mysql_get_server_info(); -mysql_info(); -mysql_insert_id(); -mysql_list_fields(); -mysql_list_processes(); -mysql_list_tables(); -mysql_num_fields(); -mysql_num_rows(); -mysql_pconnect(); -mysql_ping(); -mysql_query(); -mysql_real_escape_string(); -mysql_result(); -mysql_select_db(); -mysql_set_charset(); -mysql_stat(); -mysql_tablename(); -mysql_thread_id(); -mysql_unbuffered_query(); -mysql(); -mysql_fieldname(); -mysql_fieldtable(); -mysql_fieldlen(); -mysql_fieldtype(); -mysql_fieldflags(); -mysql_selectdb(); -mysql_createdb(); -mysql_dropdb(); -mysql_freeresult(); -mysql_numfields(); -mysql_numrows(); -mysql_listdbs(); -mysql_listtables(); -mysql_listfields(); -mysql_dbname(); -mysql_table_name(); - -// PHP 7.4 ibase extension aliases. -fbird_add_user(); -fbird_affected_rows(); -fbird_backup(); -fbird_blob_add(); -fbird_blob_cancel(); -fbird_blob_close(); -fbird_blob_create(); -fbird_blob_echo(); -fbird_blob_get(); -fbird_blob_import(); -fbird_blob_info(); -fbird_blob_open(); -fbird_close(); -fbird_commit_ret(); -fbird_commit(); -fbird_connect(); -fbird_db_info(); -fbird_delete_user(); -fbird_drop_db(); -fbird_errcode(); -fbird_errmsg(); -fbird_execute(); -fbird_fetch_assoc(); -fbird_fetch_object(); -fbird_fetch_row(); -fbird_field_info(); -fbird_free_event_handler(); -fbird_free_query(); -fbird_free_result(); -fbird_gen_id(); -fbird_maintain_db(); -fbird_modify_user(); -fbird_name_result(); -fbird_num_fields(); -fbird_num_params(); -fbird_param_info(); -fbird_pconnect(); -fbird_prepare(); -fbird_query(); -fbird_restore(); -fbird_rollback_ret(); -fbird_rollback(); -fbird_server_info(); -fbird_service_attach(); -fbird_service_detach(); -fbird_set_event_handler(); -fbird_trans(); -fbird_wait_event(); - -ovrimos_close(); -ovrimos_commit(); -ovrimos_connect(); -ovrimos_cursor(); -ovrimos_exec(); -ovrimos_execute(); -ovrimos_fetch_into(); -ovrimos_fetch_row(); -ovrimos_field_len(); -ovrimos_field_name(); -ovrimos_field_num(); -ovrimos_field_type(); -ovrimos_free_result(); -ovrimos_longreadlen(); -ovrimos_num_fields(); -ovrimos_num_rows(); -ovrimos_prepare(); -ovrimos_result_all(); -ovrimos_result(); -ovrimos_rollback(); -ovrimos_close_all(); - -ora_bind(); -ora_close(); -ora_columnname(); -ora_columnsize(); -ora_columntype(); -ora_commit(); -ora_commitoff(); -ora_commiton(); -ora_do(); -ora_error(); -ora_errorcode(); -ora_exec(); -ora_fetch_into(); -ora_fetch(); -ora_getcolumn(); -ora_logoff(); -ora_logon(); -ora_numcols(); -ora_numrows(); -ora_open(); -ora_parse(); -ora_plogon(); -ora_rollback(); -sybase_affected_rows(); -sybase_close(); -sybase_connect(); -sybase_data_seek(); -sybase_deadlock_retry_count(); -sybase_fetch_array(); -sybase_fetch_assoc(); -sybase_fetch_field(); -sybase_fetch_object(); -sybase_fetch_row(); -sybase_field_seek(); -sybase_free_result(); -sybase_get_last_message(); -sybase_min_client_severity(); -sybase_min_error_severity(); -sybase_min_message_severity(); -sybase_min_server_severity(); -sybase_num_fields(); -sybase_num_rows(); -sybase_pconnect(); -sybase_query(); -sybase_result(); -sybase_select_db(); -sybase_set_message_handler(); -sybase_unbuffered_query(); -ifx_affected_rows(); -ifx_blobinfile_mode(); -ifx_byteasvarchar(); -ifx_close(); -ifx_connect(); -ifx_copy_blob(); -ifx_create_blob(); -ifx_create_char(); -ifx_do(); -ifx_error(); -ifx_errormsg(); -ifx_fetch_row(); -ifx_fieldproperties(); -ifx_fieldtypes(); -ifx_free_blob(); -ifx_free_char(); -ifx_free_result(); -ifx_get_blob(); -ifx_get_char(); -ifx_getsqlca(); -ifx_htmltbl_result(); -ifx_nullformat(); -ifx_num_fields(); -ifx_num_rows(); -ifx_pconnect(); -ifx_prepare(); -ifx_query(); -ifx_textasvarchar(); -ifx_update_blob(); -ifx_update_char(); -ifxus_close_slob(); -ifxus_create_slob(); -ifxus_free_slob(); -ifxus_open_slob(); -ifxus_read_slob(); -ifxus_seek_slob(); -ifxus_tell_slob(); -ifxus_write_slob(); -mysqli_disable_reads_from_master(); -mysqli_disable_rpl_parse(); -mysqli_embedded_connect(); -mysqli_embedded_server_end(); -mysqli_embedded_server_start(); -mysqli_enable_reads_from_master(); -mysqli_enable_rpl_parse(); -mysqli_master_query(); -mysqli_resource(); -mysqli_rpl_parse_enabled(); -mysqli_rpl_probe(); -mysqli_server_end(); -mysqli_server_init(); -mysqli_slave_query(); -xmlrpc_decode_request(); -xmlrpc_decode(); -xmlrpc_encode_request(); -xmlrpc_encode(); -xmlrpc_get_type(); -xmlrpc_is_fault(); -xmlrpc_parse_method_descriptions(); -xmlrpc_server_add_introspection_data(); -xmlrpc_server_call_method(); -xmlrpc_server_create(); -xmlrpc_server_destroy(); -xmlrpc_server_register_introspection_callback(); -xmlrpc_server_register_method(); -xmlrpc_set_type(); -enchant_broker_get_dict_path(); -enchant_broker_set_dict_path(); -enchant_broker_free(); -enchant_broker_free_dict(); -enchant_dict_add_to_personal(); -enchant_dict_is_in_session(); -oci_internal_debug(); -zip_close(); -zip_entry_close(); -zip_entry_compressedsize(); -zip_entry_compressionmethod(); -zip_entry_filesize(); -zip_entry_name(); -zip_entry_open(); -zip_entry_read(); -zip_open(); -zip_read(); -openssl_x509_free(); -openssl_pkey_free(); -libxml_disable_entity_loader(); -pg_clientencoding(); -pg_cmdtuples(); -pg_errormessage(); -pg_fieldname(); -pg_fieldnum(); -pg_fieldisnull(); -pg_fieldprtlen(); -pg_fieldsize(); -pg_fieldtype(); -pg_freeresult(); -pg_getlastoid(); -pg_loclose(); -pg_locreate(); -pg_loexport(); -pg_loimport(); -pg_loopen(); -pg_loread(); -pg_loreadall(); -pg_lounlink(); -pg_lowrite(); -pg_numfields(); -pg_numrows(); -pg_result(); -pg_setclientencoding(); -imap_header(); -shmop_close(); -openssl_free_key(); -date_sunrise(); -date_sunset(); -strptime(); -strftime(); -gmstrftime(); -mhash_count(); -mhash_get_block_size(); -mhash_get_hash_name(); -mhash_keygen_s2k(); -mhash(); -odbc_result_all(); - -// Prevent false positives on PHP 8.0+ nullsafe method calls. -$obj?->php_check_syntax(); // OK. diff --git a/PHPCompatibility/Tests/FunctionUse/RemovedFunctionsUnitTest.php b/PHPCompatibility/Tests/FunctionUse/RemovedFunctionsUnitTest.php deleted file mode 100644 index bcc09de2..00000000 --- a/PHPCompatibility/Tests/FunctionUse/RemovedFunctionsUnitTest.php +++ /dev/null @@ -1,1553 +0,0 @@ -sniffFile(__FILE__, $okVersion); - foreach ($lines as $line) { - $this->assertNoViolation($file, $line); - } - - $errorVersion = (isset($deprecatedVersion)) ? $deprecatedVersion : $deprecatedIn; - $file = $this->sniffFile(__FILE__, $errorVersion); - $error = "Function {$functionName}() is deprecated since PHP {$deprecatedIn}"; - foreach ($lines as $line) { - $this->assertWarning($file, $line, $error); - } - } - - /** - * Data provider. - * - * @see testDeprecatedFunction() - * - * @return array - */ - public function dataDeprecatedFunction() - { - return [ - ['dl', '5.3', [6], '5.2'], - ['ocifetchinto', '5.4', [63], '5.3'], - ['enchant_broker_get_dict_path', '8.0', [1172], '7.4'], - ['enchant_broker_set_dict_path', '8.0', [1173], '7.4'], - ['libxml_disable_entity_loader', '8.0', [1191], '7.4'], - ['openssl_x509_free', '8.0', [1189], '7.4'], - ['openssl_pkey_free', '8.0', [1190], '7.4'], - ['shmop_close', '8.0', [1217], '7.4'], - ['openssl_free_key', '8.0', [1218], '7.4'], - ['odbc_result_all', '8.1', [1229], '8.0'], - ]; - } - - - /** - * testDeprecatedFunctionWithAlternative - * - * @dataProvider dataDeprecatedFunctionWithAlternative - * - * @param string $functionName Name of the function. - * @param string $deprecatedIn The PHP version in which the function was deprecated. - * @param string $alternative An alternative function. - * @param array $lines The line numbers in the test file which apply to this function. - * @param string $okVersion A PHP version in which the function was still valid. - * @param string $deprecatedVersion Optional PHP version to test deprecation message with - - * if different from the $deprecatedIn version. - * - * @return void - */ - public function testDeprecatedFunctionWithAlternative($functionName, $deprecatedIn, $alternative, $lines, $okVersion, $deprecatedVersion = null) - { - $file = $this->sniffFile(__FILE__, $okVersion); - foreach ($lines as $line) { - $this->assertNoViolation($file, $line); - } - - $errorVersion = (isset($deprecatedVersion)) ? $deprecatedVersion : $deprecatedIn; - $file = $this->sniffFile(__FILE__, $errorVersion); - $error = "Function {$functionName}() is deprecated since PHP {$deprecatedIn}; Use {$alternative} instead"; - foreach ($lines as $line) { - $this->assertWarning($file, $line, $error); - } - } - - /** - * Data provider. - * - * @see testDeprecatedFunctionWithAlternative() - * - * @return array - */ - public function dataDeprecatedFunctionWithAlternative() - { - return [ - ['ocibindbyname', '5.4', 'oci_bind_by_name()', [41], '5.3'], - ['ocicancel', '5.4', 'oci_cancel()', [42], '5.3'], - ['ocicloselob', '5.4', 'OCI-Lob::close() / OCILob::close() (PHP 8+)', [43], '5.3'], - ['ocicollappend', '5.4', 'OCI-Collection::append() / OCICollection::append() (PHP 8+)', [44], '5.3'], - ['ocicollassign', '5.4', 'OCI-Collection::assign() / OCICollection::assign() (PHP 8+)', [45], '5.3'], - ['ocicollassignelem', '5.4', 'OCI-Collection::assignElem() / OCICollection::assignElem() (PHP 8+)', [46], '5.3'], - ['ocicollgetelem', '5.4', 'OCI-Collection::getElem() / OCICollection::getElem() (PHP 8+)', [47], '5.3'], - ['ocicollmax', '5.4', 'OCI-Collection::max() / OCICollection::max() (PHP 8+)', [48], '5.3'], - ['ocicollsize', '5.4', 'OCI-Collection::size() / OCICollection::size() (PHP 8+)', [49], '5.3'], - ['ocicolltrim', '5.4', 'OCI-Collection::trim() / OCICollection::trim() (PHP 8+)', [50], '5.3'], - ['ocicolumnisnull', '5.4', 'oci_field_is_null()', [51], '5.3'], - ['ocicolumnname', '5.4', 'oci_field_name()', [52], '5.3'], - ['ocicolumnprecision', '5.4', 'oci_field_precision()', [53], '5.3'], - ['ocicolumnscale', '5.4', 'oci_field_scale()', [54], '5.3'], - ['ocicolumnsize', '5.4', 'oci_field_size()', [55], '5.3'], - ['ocicolumntype', '5.4', 'oci_field_type()', [56], '5.3'], - ['ocicolumntyperaw', '5.4', 'oci_field_type_raw()', [57], '5.3'], - ['ocicommit', '5.4', 'oci_commit()', [58], '5.3'], - ['ocidefinebyname', '5.4', 'oci_define_by_name()', [59], '5.3'], - ['ocierror', '5.4', 'oci_error()', [60], '5.3'], - ['ociexecute', '5.4', 'oci_execute()', [61], '5.3'], - ['ocifetch', '5.4', 'oci_fetch()', [62], '5.3'], - ['ocifetchstatement', '5.4', 'oci_fetch_all()', [64], '5.3'], - ['ocifreecollection', '5.4', 'OCI-Collection::free() / OCICollection::free() (PHP 8+)', [65], '5.3'], - ['ocifreecursor', '5.4', 'oci_free_statement()', [66], '5.3'], - ['ocifreedesc', '5.4', 'OCI-Lob::free() / OCILob::free() (PHP 8+)', [67], '5.3'], - ['ocifreestatement', '5.4', 'oci_free_statement()', [68], '5.3'], - ['ociloadlob', '5.4', 'OCI-Lob::load() / OCILob::load() (PHP 8+)', [70], '5.3'], - ['ocilogoff', '5.4', 'oci_close()', [71], '5.3'], - ['ocilogon', '5.4', 'oci_connect()', [72], '5.3'], - ['ocinewcollection', '5.4', 'oci_new_collection()', [73], '5.3'], - ['ocinewcursor', '5.4', 'oci_new_cursor()', [74], '5.3'], - ['ocinewdescriptor', '5.4', 'oci_new_descriptor()', [75], '5.3'], - ['ocinlogon', '5.4', 'oci_new_connect()', [76], '5.3'], - ['ocinumcols', '5.4', 'oci_num_fields()', [77], '5.3'], - ['ociparse', '5.4', 'oci_parse()', [78], '5.3'], - ['ociplogon', '5.4', 'oci_pconnect()', [79], '5.3'], - ['ociresult', '5.4', 'oci_result()', [80], '5.3'], - ['ocirollback', '5.4', 'oci_rollback()', [81], '5.3'], - ['ocirowcount', '5.4', 'oci_num_rows()', [82], '5.3'], - ['ocisavelob', '5.4', 'OCI-Lob::save() / OCILob::save() (PHP 8+)', [83], '5.3'], - ['ocisavelobfile', '5.4', 'OCI-Lob::import() / OCILob::import() (PHP 8+)', [84], '5.3'], - ['ociserverversion', '5.4', 'oci_server_version()', [85], '5.3'], - ['ocisetprefetch', '5.4', 'oci_set_prefetch()', [86], '5.3'], - ['ocistatementtype', '5.4', 'oci_statement_type()', [87], '5.3'], - ['ociwritelobtofile', '5.4', 'OCI-Lob::export() / OCILob::export() (PHP 8+)', [88], '5.3'], - ['ociwritetemporarylob', '5.4', 'OCI-Lob::writeTemporary() / OCILob::writeTemporary() (PHP 8+)', [89], '5.3'], - - ['__autoload', '7.2', 'SPL autoload', [589], '7.1'], - ['is_real', '7.4', 'is_float()', [239], '7.3'], - - ['enchant_broker_free', '8.0', 'unset the object', [1174], '7.4'], - ['enchant_broker_free_dict', '8.0', 'unset the object', [1175], '7.4'], - ['enchant_dict_add_to_personal', '8.0', 'enchant_dict_add()', [1176], '7.4'], - ['enchant_dict_is_in_session', '8.0', 'enchant_dict_is_added()', [1177], '7.4'], - ['zip_close', '8.0', 'ZipArchive::close()', [1179], '7.4'], - ['zip_entry_close', '8.0', 'ZipArchive', [1180], '7.4'], - ['zip_entry_compressedsize', '8.0', 'ZipArchive', [1181], '7.4'], - ['zip_entry_compressionmethod', '8.0', 'ZipArchive', [1182], '7.4'], - ['zip_entry_filesize', '8.0', 'ZipArchive', [1183], '7.4'], - ['zip_entry_name', '8.0', 'ZipArchive', [1184], '7.4'], - ['zip_entry_open', '8.0', 'ZipArchive', [1185], '7.4'], - ['zip_entry_read', '8.0', 'ZipArchive', [1186], '7.4'], - ['zip_open', '8.0', 'ZipArchive::open()', [1187], '7.4'], - ['zip_read', '8.0', 'ZipArchive', [1188], '7.4'], - ['pg_clientencoding', '8.0', 'pg_client_encoding()', [1192], '7.4'], - ['pg_cmdtuples', '8.0', 'pg_affected_rows()', [1193], '7.4'], - ['pg_errormessage', '8.0', 'pg_last_error()', [1194], '7.4'], - ['pg_fieldname', '8.0', 'pg_field_name()', [1195], '7.4'], - ['pg_fieldnum', '8.0', 'pg_field_num()', [1196], '7.4'], - ['pg_fieldisnull', '8.0', 'pg_field_is_null()', [1197], '7.4'], - ['pg_fieldprtlen', '8.0', 'pg_field_prtlen()', [1198], '7.4'], - ['pg_fieldsize', '8.0', 'pg_field_size()', [1199], '7.4'], - ['pg_fieldtype', '8.0', 'pg_field_type()', [1200], '7.4'], - ['pg_freeresult', '8.0', 'pg_free_result()', [1201], '7.4'], - ['pg_getlastoid', '8.0', 'pg_last_oid()', [1202], '7.4'], - ['pg_loclose', '8.0', 'pg_lo_close()', [1203], '7.4'], - ['pg_locreate', '8.0', 'pg_lo_create()', [1204], '7.4'], - ['pg_loexport', '8.0', 'pg_lo_export()', [1205], '7.4'], - ['pg_loimport', '8.0', 'pg_lo_import()', [1206], '7.4'], - ['pg_loopen', '8.0', 'pg_lo_open()', [1207], '7.4'], - ['pg_loread', '8.0', 'pg_lo_read()', [1208], '7.4'], - ['pg_loreadall', '8.0', 'pg_lo_read_all()', [1209], '7.4'], - ['pg_lounlink', '8.0', 'pg_lo_unlink()', [1210], '7.4'], - ['pg_lowrite', '8.0', 'pg_lo_write()', [1211], '7.4'], - ['pg_numfields', '8.0', 'pg_num_fields()', [1212], '7.4'], - ['pg_numrows', '8.0', 'pg_num_rows()', [1213], '7.4'], - ['pg_result', '8.0', 'pg_fetch_result()', [1214], '7.4'], - ['pg_setclientencoding', '8.0', 'pg_set_client_encoding()', [1215], '7.4'], - - ['date_sunrise', '8.1', 'date_sun_info()', [1219], '8.0'], - ['date_sunset', '8.1', 'date_sun_info()', [1220], '8.0'], - ['strptime', '8.1', 'date_parse_from_format() or IntlDateFormatter::parse()', [1221], '8.0'], - ['strftime', '8.1', 'date() or IntlDateFormatter::format()', [1222], '8.0'], - ['gmstrftime', '8.1', 'date() or IntlDateFormatter::format()', [1223], '8.0'], - ['mhash_count', '8.1', 'the hash_*() functions', [1224], '8.0'], - ['mhash_get_block_size', '8.1', 'the hash_*() functions', [1225], '8.0'], - ['mhash_get_hash_name', '8.1', 'the hash_*() functions', [1226], '8.0'], - ['mhash_keygen_s2k', '8.1', 'the hash_*() functions', [1227], '8.0'], - ['mhash', '8.1', 'the hash_*() functions', [1228], '8.0'], - ]; - } - - - /** - * testRemovedFunction - * - * @dataProvider dataRemovedFunction - * - * @param string $functionName Name of the function. - * @param string $removedIn The PHP version in which the function was removed. - * @param array $lines The line numbers in the test file which apply to this function. - * @param string $okVersion A PHP version in which the function was still valid. - * @param string $removedVersion Optional PHP version to test removed message with - - * if different from the $removedIn version. - * - * @return void - */ - public function testRemovedFunction($functionName, $removedIn, $lines, $okVersion, $removedVersion = null) - { - $file = $this->sniffFile(__FILE__, $okVersion); - foreach ($lines as $line) { - $this->assertNoViolation($file, $line); - } - - $errorVersion = (isset($removedVersion)) ? $removedVersion : $removedIn; - $file = $this->sniffFile(__FILE__, $errorVersion); - $error = "Function {$functionName}() is removed since PHP {$removedIn}"; - foreach ($lines as $line) { - $this->assertError($file, $line, $error); - } - } - - /** - * Data provider. - * - * @see testRemovedFunction() - * - * @return array - */ - public function dataRemovedFunction() - { - return [ - ['crack_check', '5.0', [592], '4.4'], - ['crack_closedict', '5.0', [593], '4.4'], - ['crack_getlastmessage', '5.0', [594], '4.4'], - ['crack_opendict', '5.0', [595], '4.4'], - - ['pfpro_cleanup', '5.1', [221], '5.0'], - ['pfpro_init', '5.1', [222], '5.0'], - ['pfpro_process_raw', '5.1', [223], '5.0'], - ['pfpro_process', '5.1', [224], '5.0'], - ['pfpro_version', '5.1', [225], '5.0'], - ['m_checkstatus', '5.1', [417], '5.0'], - ['m_completeauthorizations', '5.1', [418], '5.0'], - ['m_connect', '5.1', [419], '5.0'], - ['m_connectionerror', '5.1', [420], '5.0'], - ['m_deletetrans', '5.1', [421], '5.0'], - ['m_destroyconn', '5.1', [422], '5.0'], - ['m_destroyengine', '5.1', [423], '5.0'], - ['m_getcell', '5.1', [424], '5.0'], - ['m_getcellbynum', '5.1', [425], '5.0'], - ['m_getcommadelimited', '5.1', [426], '5.0'], - ['m_getheader', '5.1', [427], '5.0'], - ['m_initconn', '5.1', [428], '5.0'], - ['m_initengine', '5.1', [429], '5.0'], - ['m_iscommadelimited', '5.1', [430], '5.0'], - ['m_maxconntimeout', '5.1', [431], '5.0'], - ['m_monitor', '5.1', [432], '5.0'], - ['m_numcolumns', '5.1', [433], '5.0'], - ['m_numrows', '5.1', [434], '5.0'], - ['m_parsecommadelimited', '5.1', [435], '5.0'], - ['m_responsekeys', '5.1', [436], '5.0'], - ['m_responseparam', '5.1', [437], '5.0'], - ['m_returnstatus', '5.1', [438], '5.0'], - ['m_setblocking', '5.1', [439], '5.0'], - ['m_setdropfile', '5.1', [440], '5.0'], - ['m_setip', '5.1', [441], '5.0'], - ['m_setssl_cafile', '5.1', [442], '5.0'], - ['m_setssl_files', '5.1', [443], '5.0'], - ['m_setssl', '5.1', [444], '5.0'], - ['m_settimeout', '5.1', [445], '5.0'], - ['m_sslcert_gen_hash', '5.1', [446], '5.0'], - ['m_transactionssent', '5.1', [447], '5.0'], - ['m_transinqueue', '5.1', [448], '5.0'], - ['m_transkeyval', '5.1', [449], '5.0'], - ['m_transnew', '5.1', [450], '5.0'], - ['m_transsend', '5.1', [451], '5.0'], - ['m_uwait', '5.1', [452], '5.0'], - ['m_validateidentifier', '5.1', [453], '5.0'], - ['m_verifyconnection', '5.1', [454], '5.0'], - ['m_verifysslcert', '5.1', [455], '5.0'], - ['dio_close', '5.1', [458], '5.0'], - ['dio_fcntl', '5.1', [459], '5.0'], - ['dio_open', '5.1', [460], '5.0'], - ['dio_read', '5.1', [461], '5.0'], - ['dio_seek', '5.1', [462], '5.0'], - ['dio_stat', '5.1', [463], '5.0'], - ['dio_tcsetattr', '5.1', [464], '5.0'], - ['dio_truncate', '5.1', [465], '5.0'], - ['dio_write', '5.1', [466], '5.0'], - ['fam_cancel_monitor', '5.1', [514], '5.0'], - ['fam_close', '5.1', [515], '5.0'], - ['fam_monitor_collection', '5.1', [516], '5.0'], - ['fam_monitor_directory', '5.1', [517], '5.0'], - ['fam_monitor_file', '5.1', [518], '5.0'], - ['fam_next_event', '5.1', [519], '5.0'], - ['fam_open', '5.1', [520], '5.0'], - ['fam_pending', '5.1', [521], '5.0'], - ['fam_resume_monitor', '5.1', [522], '5.0'], - ['fam_suspend_monitor', '5.1', [523], '5.0'], - ['yp_all', '5.1', [532], '5.0'], - ['yp_cat', '5.1', [533], '5.0'], - ['yp_err_string', '5.1', [534], '5.0'], - ['yp_errno', '5.1', [535], '5.0'], - ['yp_first', '5.1', [536], '5.0'], - ['yp_get_default_domain', '5.1', [537], '5.0'], - ['yp_master', '5.1', [538], '5.0'], - ['yp_match', '5.1', [539], '5.0'], - ['yp_next', '5.1', [540], '5.0'], - ['yp_order', '5.1', [541], '5.0'], - ['udm_add_search_limit', '5.1', [544], '5.0'], - ['udm_alloc_agent_array', '5.1', [545], '5.0'], - ['udm_alloc_agent', '5.1', [546], '5.0'], - ['udm_api_version', '5.1', [547], '5.0'], - ['udm_cat_list', '5.1', [548], '5.0'], - ['udm_cat_path', '5.1', [549], '5.0'], - ['udm_check_charset', '5.1', [550], '5.0'], - ['udm_clear_search_limits', '5.1', [551], '5.0'], - ['udm_crc32', '5.1', [552], '5.0'], - ['udm_errno', '5.1', [553], '5.0'], - ['udm_error', '5.1', [554], '5.0'], - ['udm_find', '5.1', [555], '5.0'], - ['udm_free_agent', '5.1', [556], '5.0'], - ['udm_free_ispell_data', '5.1', [557], '5.0'], - ['udm_free_res', '5.1', [558], '5.0'], - ['udm_get_doc_count', '5.1', [559], '5.0'], - ['udm_get_res_field', '5.1', [560], '5.0'], - ['udm_get_res_param', '5.1', [561], '5.0'], - ['udm_hash32', '5.1', [562], '5.0'], - ['udm_load_ispell_data', '5.1', [563], '5.0'], - ['udm_set_agent_param', '5.1', [564], '5.0'], - ['w32api_deftype', '5.1', [598], '5.0'], - ['w32api_init_dtype', '5.1', [599], '5.0'], - ['w32api_invoke_function', '5.1', [600], '5.0'], - ['w32api_register_function', '5.1', [601], '5.0'], - ['w32api_set_call_method', '5.1', [602], '5.0'], - ['cpdf_add_annotation', '5.1', [605], '5.0'], - ['cpdf_add_outline', '5.1', [606], '5.0'], - ['cpdf_arc', '5.1', [607], '5.0'], - ['cpdf_begin_text', '5.1', [608], '5.0'], - ['cpdf_circle', '5.1', [609], '5.0'], - ['cpdf_clip', '5.1', [610], '5.0'], - ['cpdf_close', '5.1', [611], '5.0'], - ['cpdf_closepath_fill_stroke', '5.1', [612], '5.0'], - ['cpdf_closepath_stroke', '5.1', [613], '5.0'], - ['cpdf_closepath', '5.1', [614], '5.0'], - ['cpdf_continue_text', '5.1', [615], '5.0'], - ['cpdf_curveto', '5.1', [616], '5.0'], - ['cpdf_end_text', '5.1', [617], '5.0'], - ['cpdf_fill_stroke', '5.1', [618], '5.0'], - ['cpdf_fill', '5.1', [619], '5.0'], - ['cpdf_finalize_page', '5.1', [620], '5.0'], - ['cpdf_finalize', '5.1', [621], '5.0'], - ['cpdf_global_set_document_limits', '5.1', [622], '5.0'], - ['cpdf_import_jpeg', '5.1', [623], '5.0'], - ['cpdf_lineto', '5.1', [624], '5.0'], - ['cpdf_moveto', '5.1', [625], '5.0'], - ['cpdf_newpath', '5.1', [626], '5.0'], - ['cpdf_open', '5.1', [627], '5.0'], - ['cpdf_output_buffer', '5.1', [628], '5.0'], - ['cpdf_page_init', '5.1', [629], '5.0'], - ['cpdf_place_inline_image', '5.1', [630], '5.0'], - ['cpdf_rect', '5.1', [631], '5.0'], - ['cpdf_restore', '5.1', [632], '5.0'], - ['cpdf_rlineto', '5.1', [633], '5.0'], - ['cpdf_rmoveto', '5.1', [634], '5.0'], - ['cpdf_rotate_text', '5.1', [635], '5.0'], - ['cpdf_rotate', '5.1', [636], '5.0'], - ['cpdf_save_to_file', '5.1', [637], '5.0'], - ['cpdf_save', '5.1', [638], '5.0'], - ['cpdf_scale', '5.1', [639], '5.0'], - ['cpdf_set_action_url', '5.1', [640], '5.0'], - ['cpdf_set_char_spacing', '5.1', [641], '5.0'], - ['cpdf_set_creator', '5.1', [642], '5.0'], - ['cpdf_set_current_page', '5.1', [643], '5.0'], - ['cpdf_set_font_directories', '5.1', [644], '5.0'], - ['cpdf_set_font_map_file', '5.1', [645], '5.0'], - ['cpdf_set_font', '5.1', [646], '5.0'], - ['cpdf_set_horiz_scaling', '5.1', [647], '5.0'], - ['cpdf_set_keywords', '5.1', [648], '5.0'], - ['cpdf_set_leading', '5.1', [649], '5.0'], - ['cpdf_set_page_animation', '5.1', [650], '5.0'], - ['cpdf_set_subject', '5.1', [651], '5.0'], - ['cpdf_set_text_matrix', '5.1', [652], '5.0'], - ['cpdf_set_text_pos', '5.1', [653], '5.0'], - ['cpdf_set_text_rendering', '5.1', [654], '5.0'], - ['cpdf_set_text_rise', '5.1', [655], '5.0'], - ['cpdf_set_title', '5.1', [656], '5.0'], - ['cpdf_set_viewer_preferences', '5.1', [657], '5.0'], - ['cpdf_set_word_spacing', '5.1', [658], '5.0'], - ['cpdf_setdash', '5.1', [659], '5.0'], - ['cpdf_setflat', '5.1', [660], '5.0'], - ['cpdf_setgray_fill', '5.1', [661], '5.0'], - ['cpdf_setgray_stroke', '5.1', [662], '5.0'], - ['cpdf_setgray', '5.1', [663], '5.0'], - ['cpdf_setlinecap', '5.1', [664], '5.0'], - ['cpdf_setlinejoin', '5.1', [665], '5.0'], - ['cpdf_setlinewidth', '5.1', [666], '5.0'], - ['cpdf_setmiterlimit', '5.1', [667], '5.0'], - ['cpdf_setrgbcolor_fill', '5.1', [668], '5.0'], - ['cpdf_setrgbcolor_stroke', '5.1', [669], '5.0'], - ['cpdf_setrgbcolor', '5.1', [670], '5.0'], - ['cpdf_show_xy', '5.1', [671], '5.0'], - ['cpdf_show', '5.1', [672], '5.0'], - ['cpdf_stringwidth', '5.1', [673], '5.0'], - ['cpdf_stroke', '5.1', [674], '5.0'], - ['cpdf_text', '5.1', [675], '5.0'], - ['cpdf_translate', '5.1', [676], '5.0'], - ['ircg_channel_mode', '5.1', [677], '5.0'], - ['ircg_disconnect', '5.1', [678], '5.0'], - ['ircg_eval_ecmascript_params', '5.1', [679], '5.0'], - ['ircg_fetch_error_msg', '5.1', [680], '5.0'], - ['ircg_get_username', '5.1', [681], '5.0'], - ['ircg_html_encode', '5.1', [682], '5.0'], - ['ircg_ignore_add', '5.1', [683], '5.0'], - ['ircg_ignore_del', '5.1', [684], '5.0'], - ['ircg_invite', '5.1', [685], '5.0'], - ['ircg_is_conn_alive', '5.1', [686], '5.0'], - ['ircg_join', '5.1', [687], '5.0'], - ['ircg_kick', '5.1', [688], '5.0'], - ['ircg_list', '5.1', [689], '5.0'], - ['ircg_lookup_format_messages', '5.1', [690], '5.0'], - ['ircg_lusers', '5.1', [691], '5.0'], - ['ircg_msg', '5.1', [692], '5.0'], - ['ircg_names', '5.1', [693], '5.0'], - ['ircg_nick', '5.1', [694], '5.0'], - ['ircg_nickname_escape', '5.1', [695], '5.0'], - ['ircg_nickname_unescape', '5.1', [696], '5.0'], - ['ircg_notice', '5.1', [697], '5.0'], - ['ircg_oper', '5.1', [698], '5.0'], - ['ircg_part', '5.1', [699], '5.0'], - ['ircg_pconnect', '5.1', [700], '5.0'], - ['ircg_register_format_messages', '5.1', [701], '5.0'], - ['ircg_set_current', '5.1', [702], '5.0'], - ['ircg_set_file', '5.1', [703], '5.0'], - ['ircg_set_on_die', '5.1', [704], '5.0'], - ['ircg_topic', '5.1', [705], '5.0'], - ['ircg_who', '5.1', [706], '5.0'], - ['ircg_whois', '5.1', [707], '5.0'], - ['dbx_close', '5.1', [720], '5.0'], - ['dbx_compare', '5.1', [721], '5.0'], - ['dbx_connect', '5.1', [722], '5.0'], - ['dbx_error', '5.1', [723], '5.0'], - ['dbx_escape_string', '5.1', [724], '5.0'], - ['dbx_fetch_row', '5.1', [725], '5.0'], - ['dbx_query', '5.1', [726], '5.0'], - ['dbx_sort', '5.1', [727], '5.0'], - ['ingres_autocommit', '5.1', [795], '5.0'], - ['ingres_close', '5.1', [796], '5.0'], - ['ingres_commit', '5.1', [797], '5.0'], - ['ingres_connect', '5.1', [798], '5.0'], - ['ingres_fetch_array', '5.1', [799], '5.0'], - ['ingres_fetch_object', '5.1', [800], '5.0'], - ['ingres_fetch_row', '5.1', [801], '5.0'], - ['ingres_field_length', '5.1', [802], '5.0'], - ['ingres_field_name', '5.1', [803], '5.0'], - ['ingres_field_nullable', '5.1', [804], '5.0'], - ['ingres_field_precision', '5.1', [805], '5.0'], - ['ingres_field_scale', '5.1', [806], '5.0'], - ['ingres_field_type', '5.1', [807], '5.0'], - ['ingres_num_fields', '5.1', [808], '5.0'], - ['ingres_num_rows', '5.1', [809], '5.0'], - ['ingres_pconnect', '5.1', [810], '5.0'], - ['ingres_query', '5.1', [811], '5.0'], - ['ingres_rollback', '5.1', [812], '5.0'], - ['ovrimos_close', '5.1', [1036], '5.0'], - ['ovrimos_commit', '5.1', [1037], '5.0'], - ['ovrimos_connect', '5.1', [1038], '5.0'], - ['ovrimos_cursor', '5.1', [1039], '5.0'], - ['ovrimos_exec', '5.1', [1040], '5.0'], - ['ovrimos_execute', '5.1', [1041], '5.0'], - ['ovrimos_fetch_into', '5.1', [1042], '5.0'], - ['ovrimos_fetch_row', '5.1', [1043], '5.0'], - ['ovrimos_field_len', '5.1', [1044], '5.0'], - ['ovrimos_field_name', '5.1', [1045], '5.0'], - ['ovrimos_field_num', '5.1', [1046], '5.0'], - ['ovrimos_field_type', '5.1', [1047], '5.0'], - ['ovrimos_free_result', '5.1', [1048], '5.0'], - ['ovrimos_longreadlen', '5.1', [1049], '5.0'], - ['ovrimos_num_fields', '5.1', [1050], '5.0'], - ['ovrimos_num_rows', '5.1', [1051], '5.0'], - ['ovrimos_prepare', '5.1', [1052], '5.0'], - ['ovrimos_result_all', '5.1', [1053], '5.0'], - ['ovrimos_result', '5.1', [1054], '5.0'], - ['ovrimos_rollback', '5.1', [1055], '5.0'], - ['ovrimos_close_all', '5.1', [1056], '5.0'], - ['ora_bind', '5.1', [1058], '5.0'], - ['ora_close', '5.1', [1059], '5.0'], - ['ora_columnname', '5.1', [1060], '5.0'], - ['ora_columnsize', '5.1', [1061], '5.0'], - ['ora_columntype', '5.1', [1062], '5.0'], - ['ora_commit', '5.1', [1063], '5.0'], - ['ora_commitoff', '5.1', [1064], '5.0'], - ['ora_commiton', '5.1', [1065], '5.0'], - ['ora_do', '5.1', [1066], '5.0'], - ['ora_error', '5.1', [1067], '5.0'], - ['ora_errorcode', '5.1', [1068], '5.0'], - ['ora_exec', '5.1', [1069], '5.0'], - ['ora_fetch_into', '5.1', [1070], '5.0'], - ['ora_fetch', '5.1', [1071], '5.0'], - ['ora_getcolumn', '5.1', [1072], '5.0'], - ['ora_logoff', '5.1', [1073], '5.0'], - ['ora_logon', '5.1', [1074], '5.0'], - ['ora_numcols', '5.1', [1075], '5.0'], - ['ora_numrows', '5.1', [1076], '5.0'], - ['ora_open', '5.1', [1077], '5.0'], - ['ora_parse', '5.1', [1078], '5.0'], - ['ora_plogon', '5.1', [1079], '5.0'], - ['ora_rollback', '5.1', [1080], '5.0'], - ['mysqli_embedded_connect', '5.1', [1146], '5.0'], - ['mysqli_server_end', '5.1', [1155], '5.0'], - ['mysqli_server_init', '5.1', [1156], '5.0'], - - ['msession_connect', '5.1.3', [567], '5.1', '5.2'], - ['msession_count', '5.1.3', [568], '5.1', '5.2'], - ['msession_create', '5.1.3', [569], '5.1', '5.2'], - ['msession_destroy', '5.1.3', [570], '5.1', '5.2'], - ['msession_disconnect', '5.1.3', [571], '5.1', '5.2'], - ['msession_find', '5.1.3', [572], '5.1', '5.2'], - ['msession_get_array', '5.1.3', [573], '5.1', '5.2'], - ['msession_get_data', '5.1.3', [574], '5.1', '5.2'], - ['msession_get', '5.1.3', [575], '5.1', '5.2'], - ['msession_inc', '5.1.3', [576], '5.1', '5.2'], - ['msession_list', '5.1.3', [577], '5.1', '5.2'], - ['msession_listvar', '5.1.3', [578], '5.1', '5.2'], - ['msession_lock', '5.1.3', [579], '5.1', '5.2'], - ['msession_plugin', '5.1.3', [580], '5.1', '5.2'], - ['msession_randstr', '5.1.3', [581], '5.1', '5.2'], - ['msession_set_array', '5.1.3', [582], '5.1', '5.2'], - ['msession_set_data', '5.1.3', [583], '5.1', '5.2'], - ['msession_set', '5.1.3', [584], '5.1', '5.2'], - ['msession_timeout', '5.1.3', [585], '5.1', '5.2'], - ['msession_uniq', '5.1.3', [586], '5.1', '5.2'], - ['msession_unlock', '5.1.3', [587], '5.1', '5.2'], - - ['mysqli_resource', '5.1.4', [1152], '5.1', '5.2'], - - ['mysql_createdb', '5.1.7', [975], '5.1', '5.2'], - ['mysql_dropdb', '5.1.7', [976], '5.1', '5.2'], - ['mysql_listtables', '5.1.7', [981], '5.1', '5.2'], - - ['hwapi_attribute_new', '5.2', [526], '5.1'], - ['hwapi_content_new', '5.2', [527], '5.1'], - ['hwapi_hgcsp', '5.2', [528], '5.1'], - ['hwapi_object_new', '5.2', [529], '5.1'], - ['filepro_fieldcount', '5.2', [788], '5.1'], - ['filepro_fieldname', '5.2', [789], '5.1'], - ['filepro_fieldtype', '5.2', [790], '5.1'], - ['filepro_fieldwidth', '5.2', [791], '5.1'], - ['filepro_retrieve', '5.2', [792], '5.1'], - ['filepro_rowcount', '5.2', [793], '5.1'], - ['filepro', '5.2', [794], '5.1'], - - ['ifx_affected_rows', '5.2.1', [1106], '5.2', '5.3'], - ['ifx_blobinfile_mode', '5.2.1', [1107], '5.2', '5.3'], - ['ifx_byteasvarchar', '5.2.1', [1108], '5.2', '5.3'], - ['ifx_close', '5.2.1', [1109], '5.2', '5.3'], - ['ifx_connect', '5.2.1', [1110], '5.2', '5.3'], - ['ifx_copy_blob', '5.2.1', [1111], '5.2', '5.3'], - ['ifx_create_blob', '5.2.1', [1112], '5.2', '5.3'], - ['ifx_create_char', '5.2.1', [1113], '5.2', '5.3'], - ['ifx_do', '5.2.1', [1114], '5.2', '5.3'], - ['ifx_error', '5.2.1', [1115], '5.2', '5.3'], - ['ifx_errormsg', '5.2.1', [1116], '5.2', '5.3'], - ['ifx_fetch_row', '5.2.1', [1117], '5.2', '5.3'], - ['ifx_fieldproperties', '5.2.1', [1118], '5.2', '5.3'], - ['ifx_fieldtypes', '5.2.1', [1119], '5.2', '5.3'], - ['ifx_free_blob', '5.2.1', [1120], '5.2', '5.3'], - ['ifx_free_char', '5.2.1', [1121], '5.2', '5.3'], - ['ifx_free_result', '5.2.1', [1122], '5.2', '5.3'], - ['ifx_get_blob', '5.2.1', [1123], '5.2', '5.3'], - ['ifx_get_char', '5.2.1', [1124], '5.2', '5.3'], - ['ifx_getsqlca', '5.2.1', [1125], '5.2', '5.3'], - ['ifx_htmltbl_result', '5.2.1', [1126], '5.2', '5.3'], - ['ifx_nullformat', '5.2.1', [1127], '5.2', '5.3'], - ['ifx_num_fields', '5.2.1', [1128], '5.2', '5.3'], - ['ifx_num_rows', '5.2.1', [1129], '5.2', '5.3'], - ['ifx_pconnect', '5.2.1', [1130], '5.2', '5.3'], - ['ifx_prepare', '5.2.1', [1131], '5.2', '5.3'], - ['ifx_query', '5.2.1', [1132], '5.2', '5.3'], - ['ifx_textasvarchar', '5.2.1', [1133], '5.2', '5.3'], - ['ifx_update_blob', '5.2.1', [1134], '5.2', '5.3'], - ['ifx_update_char', '5.2.1', [1135], '5.2', '5.3'], - ['ifxus_close_slob', '5.2.1', [1136], '5.2', '5.3'], - ['ifxus_create_slob', '5.2.1', [1137], '5.2', '5.3'], - ['ifxus_free_slob', '5.2.1', [1138], '5.2', '5.3'], - ['ifxus_open_slob', '5.2.1', [1139], '5.2', '5.3'], - ['ifxus_read_slob', '5.2.1', [1140], '5.2', '5.3'], - ['ifxus_seek_slob', '5.2.1', [1141], '5.2', '5.3'], - ['ifxus_tell_slob', '5.2.1', [1142], '5.2', '5.3'], - ['ifxus_write_slob', '5.2.1', [1143], '5.2', '5.3'], - - ['ncurses_addch', '5.3', [255], '5.2'], - ['ncurses_addchnstr', '5.3', [256], '5.2'], - ['ncurses_addchstr', '5.3', [257], '5.2'], - ['ncurses_addnstr', '5.3', [258], '5.2'], - ['ncurses_addstr', '5.3', [259], '5.2'], - ['ncurses_assume_default_colors', '5.3', [260], '5.2'], - ['ncurses_attroff', '5.3', [261], '5.2'], - ['ncurses_attron', '5.3', [262], '5.2'], - ['ncurses_attrset', '5.3', [263], '5.2'], - ['ncurses_baudrate', '5.3', [264], '5.2'], - ['ncurses_beep', '5.3', [265], '5.2'], - ['ncurses_bkgd', '5.3', [266], '5.2'], - ['ncurses_bkgdset', '5.3', [267], '5.2'], - ['ncurses_border', '5.3', [268], '5.2'], - ['ncurses_bottom_panel', '5.3', [269], '5.2'], - ['ncurses_can_change_color', '5.3', [270], '5.2'], - ['ncurses_cbreak', '5.3', [271], '5.2'], - ['ncurses_clear', '5.3', [272], '5.2'], - ['ncurses_clrtobot', '5.3', [273], '5.2'], - ['ncurses_clrtoeol', '5.3', [274], '5.2'], - ['ncurses_color_content', '5.3', [275], '5.2'], - ['ncurses_color_set', '5.3', [276], '5.2'], - ['ncurses_curs_set', '5.3', [277], '5.2'], - ['ncurses_def_prog_mode', '5.3', [278], '5.2'], - ['ncurses_def_shell_mode', '5.3', [279], '5.2'], - ['ncurses_define_key', '5.3', [280], '5.2'], - ['ncurses_del_panel', '5.3', [281], '5.2'], - ['ncurses_delay_output', '5.3', [282], '5.2'], - ['ncurses_delch', '5.3', [283], '5.2'], - ['ncurses_deleteln', '5.3', [284], '5.2'], - ['ncurses_delwin', '5.3', [285], '5.2'], - ['ncurses_doupdate', '5.3', [286], '5.2'], - ['ncurses_echo', '5.3', [287], '5.2'], - ['ncurses_echochar', '5.3', [288], '5.2'], - ['ncurses_end', '5.3', [289], '5.2'], - ['ncurses_erase', '5.3', [290], '5.2'], - ['ncurses_erasechar', '5.3', [291], '5.2'], - ['ncurses_filter', '5.3', [292], '5.2'], - ['ncurses_flash', '5.3', [293], '5.2'], - ['ncurses_flushinp', '5.3', [294], '5.2'], - ['ncurses_getch', '5.3', [295], '5.2'], - ['ncurses_getmaxyx', '5.3', [296], '5.2'], - ['ncurses_getmouse', '5.3', [297], '5.2'], - ['ncurses_getyx', '5.3', [298], '5.2'], - ['ncurses_halfdelay', '5.3', [299], '5.2'], - ['ncurses_has_colors', '5.3', [300], '5.2'], - ['ncurses_has_ic', '5.3', [301], '5.2'], - ['ncurses_has_il', '5.3', [302], '5.2'], - ['ncurses_has_key', '5.3', [303], '5.2'], - ['ncurses_hide_panel', '5.3', [304], '5.2'], - ['ncurses_hline', '5.3', [305], '5.2'], - ['ncurses_inch', '5.3', [306], '5.2'], - ['ncurses_init_color', '5.3', [307], '5.2'], - ['ncurses_init_pair', '5.3', [308], '5.2'], - ['ncurses_init', '5.3', [309], '5.2'], - ['ncurses_insch', '5.3', [310], '5.2'], - ['ncurses_insdelln', '5.3', [311], '5.2'], - ['ncurses_insertln', '5.3', [312], '5.2'], - ['ncurses_insstr', '5.3', [313], '5.2'], - ['ncurses_instr', '5.3', [314], '5.2'], - ['ncurses_isendwin', '5.3', [315], '5.2'], - ['ncurses_keyok', '5.3', [316], '5.2'], - ['ncurses_keypad', '5.3', [317], '5.2'], - ['ncurses_killchar', '5.3', [318], '5.2'], - ['ncurses_longname', '5.3', [319], '5.2'], - ['ncurses_meta', '5.3', [320], '5.2'], - ['ncurses_mouse_trafo', '5.3', [321], '5.2'], - ['ncurses_mouseinterval', '5.3', [322], '5.2'], - ['ncurses_mousemask', '5.3', [323], '5.2'], - ['ncurses_move_panel', '5.3', [324], '5.2'], - ['ncurses_move', '5.3', [325], '5.2'], - ['ncurses_mvaddch', '5.3', [326], '5.2'], - ['ncurses_mvaddchnstr', '5.3', [327], '5.2'], - ['ncurses_mvaddchstr', '5.3', [328], '5.2'], - ['ncurses_mvaddnstr', '5.3', [329], '5.2'], - ['ncurses_mvaddstr', '5.3', [330], '5.2'], - ['ncurses_mvcur', '5.3', [331], '5.2'], - ['ncurses_mvdelch', '5.3', [332], '5.2'], - ['ncurses_mvgetch', '5.3', [333], '5.2'], - ['ncurses_mvhline', '5.3', [334], '5.2'], - ['ncurses_mvinch', '5.3', [335], '5.2'], - ['ncurses_mvvline', '5.3', [336], '5.2'], - ['ncurses_mvwaddstr', '5.3', [337], '5.2'], - ['ncurses_napms', '5.3', [338], '5.2'], - ['ncurses_new_panel', '5.3', [339], '5.2'], - ['ncurses_newpad', '5.3', [340], '5.2'], - ['ncurses_newwin', '5.3', [341], '5.2'], - ['ncurses_nl', '5.3', [342], '5.2'], - ['ncurses_nocbreak', '5.3', [343], '5.2'], - ['ncurses_noecho', '5.3', [344], '5.2'], - ['ncurses_nonl', '5.3', [345], '5.2'], - ['ncurses_noqiflush', '5.3', [346], '5.2'], - ['ncurses_noraw', '5.3', [347], '5.2'], - ['ncurses_pair_content', '5.3', [348], '5.2'], - ['ncurses_panel_above', '5.3', [349], '5.2'], - ['ncurses_panel_below', '5.3', [350], '5.2'], - ['ncurses_panel_window', '5.3', [351], '5.2'], - ['ncurses_pnoutrefresh', '5.3', [352], '5.2'], - ['ncurses_prefresh', '5.3', [353], '5.2'], - ['ncurses_putp', '5.3', [354], '5.2'], - ['ncurses_qiflush', '5.3', [355], '5.2'], - ['ncurses_raw', '5.3', [356], '5.2'], - ['ncurses_refresh', '5.3', [357], '5.2'], - ['ncurses_replace_panel', '5.3', [358], '5.2'], - ['ncurses_reset_prog_mode', '5.3', [359], '5.2'], - ['ncurses_reset_shell_mode', '5.3', [360], '5.2'], - ['ncurses_resetty', '5.3', [361], '5.2'], - ['ncurses_savetty', '5.3', [362], '5.2'], - ['ncurses_scr_dump', '5.3', [363], '5.2'], - ['ncurses_scr_init', '5.3', [364], '5.2'], - ['ncurses_scr_restore', '5.3', [365], '5.2'], - ['ncurses_scr_set', '5.3', [366], '5.2'], - ['ncurses_scrl', '5.3', [367], '5.2'], - ['ncurses_show_panel', '5.3', [368], '5.2'], - ['ncurses_slk_attr', '5.3', [369], '5.2'], - ['ncurses_slk_attroff', '5.3', [370], '5.2'], - ['ncurses_slk_attron', '5.3', [371], '5.2'], - ['ncurses_slk_attrset', '5.3', [372], '5.2'], - ['ncurses_slk_clear', '5.3', [373], '5.2'], - ['ncurses_slk_color', '5.3', [374], '5.2'], - ['ncurses_slk_init', '5.3', [375], '5.2'], - ['ncurses_slk_noutrefresh', '5.3', [376], '5.2'], - ['ncurses_slk_refresh', '5.3', [377], '5.2'], - ['ncurses_slk_restore', '5.3', [378], '5.2'], - ['ncurses_slk_set', '5.3', [379], '5.2'], - ['ncurses_slk_touch', '5.3', [380], '5.2'], - ['ncurses_standend', '5.3', [381], '5.2'], - ['ncurses_standout', '5.3', [382], '5.2'], - ['ncurses_start_color', '5.3', [383], '5.2'], - ['ncurses_termattrs', '5.3', [384], '5.2'], - ['ncurses_termname', '5.3', [385], '5.2'], - ['ncurses_timeout', '5.3', [386], '5.2'], - ['ncurses_top_panel', '5.3', [387], '5.2'], - ['ncurses_typeahead', '5.3', [388], '5.2'], - ['ncurses_ungetch', '5.3', [389], '5.2'], - ['ncurses_ungetmouse', '5.3', [390], '5.2'], - ['ncurses_update_panels', '5.3', [391], '5.2'], - ['ncurses_use_default_colors', '5.3', [392], '5.2'], - ['ncurses_use_env', '5.3', [393], '5.2'], - ['ncurses_use_extended_names', '5.3', [394], '5.2'], - ['ncurses_vidattr', '5.3', [395], '5.2'], - ['ncurses_vline', '5.3', [396], '5.2'], - ['ncurses_waddch', '5.3', [397], '5.2'], - ['ncurses_waddstr', '5.3', [398], '5.2'], - ['ncurses_wattroff', '5.3', [399], '5.2'], - ['ncurses_wattron', '5.3', [400], '5.2'], - ['ncurses_wattrset', '5.3', [401], '5.2'], - ['ncurses_wborder', '5.3', [402], '5.2'], - ['ncurses_wclear', '5.3', [403], '5.2'], - ['ncurses_wcolor_set', '5.3', [404], '5.2'], - ['ncurses_werase', '5.3', [405], '5.2'], - ['ncurses_wgetch', '5.3', [406], '5.2'], - ['ncurses_whline', '5.3', [407], '5.2'], - ['ncurses_wmouse_trafo', '5.3', [408], '5.2'], - ['ncurses_wmove', '5.3', [409], '5.2'], - ['ncurses_wnoutrefresh', '5.3', [410], '5.2'], - ['ncurses_wrefresh', '5.3', [411], '5.2'], - ['ncurses_wstandend', '5.3', [412], '5.2'], - ['ncurses_wstandout', '5.3', [413], '5.2'], - ['ncurses_wvline', '5.3', [414], '5.2'], - ['fdf_add_doc_javascript', '5.3', [469], '5.2'], - ['fdf_add_template', '5.3', [470], '5.2'], - ['fdf_close', '5.3', [471], '5.2'], - ['fdf_create', '5.3', [472], '5.2'], - ['fdf_enum_values', '5.3', [473], '5.2'], - ['fdf_errno', '5.3', [474], '5.2'], - ['fdf_error', '5.3', [475], '5.2'], - ['fdf_get_ap', '5.3', [476], '5.2'], - ['fdf_get_attachment', '5.3', [477], '5.2'], - ['fdf_get_encoding', '5.3', [478], '5.2'], - ['fdf_get_file', '5.3', [479], '5.2'], - ['fdf_get_flags', '5.3', [480], '5.2'], - ['fdf_get_opt', '5.3', [481], '5.2'], - ['fdf_get_status', '5.3', [482], '5.2'], - ['fdf_get_value', '5.3', [483], '5.2'], - ['fdf_get_version', '5.3', [484], '5.2'], - ['fdf_header', '5.3', [485], '5.2'], - ['fdf_next_field_name', '5.3', [486], '5.2'], - ['fdf_open_string', '5.3', [487], '5.2'], - ['fdf_open', '5.3', [488], '5.2'], - ['fdf_remove_item', '5.3', [489], '5.2'], - ['fdf_save_string', '5.3', [490], '5.2'], - ['fdf_save', '5.3', [491], '5.2'], - ['fdf_set_ap', '5.3', [492], '5.2'], - ['fdf_set_encoding', '5.3', [493], '5.2'], - ['fdf_set_file', '5.3', [494], '5.2'], - ['fdf_set_flags', '5.3', [495], '5.2'], - ['fdf_set_javascript_action', '5.3', [496], '5.2'], - ['fdf_set_on_import_javascript', '5.3', [497], '5.2'], - ['fdf_set_opt', '5.3', [498], '5.2'], - ['fdf_set_status', '5.3', [499], '5.2'], - ['fdf_set_submit_form_action', '5.3', [500], '5.2'], - ['fdf_set_target_frame', '5.3', [501], '5.2'], - ['fdf_set_value', '5.3', [502], '5.2'], - ['fdf_set_version', '5.3', [503], '5.2'], - ['ming_keypress', '5.3', [506], '5.2'], - ['ming_setcubicthreshold', '5.3', [507], '5.2'], - ['ming_setscale', '5.3', [508], '5.2'], - ['ming_setswfcompression', '5.3', [509], '5.2'], - ['ming_useconstants', '5.3', [510], '5.2'], - ['ming_useswfversion', '5.3', [511], '5.2'], - ['dbase_add_record', '5.3', [708], '5.2'], - ['dbase_close', '5.3', [709], '5.2'], - ['dbase_create', '5.3', [710], '5.2'], - ['dbase_delete_record', '5.3', [711], '5.2'], - ['dbase_get_header_info', '5.3', [712], '5.2'], - ['dbase_get_record_with_names', '5.3', [713], '5.2'], - ['dbase_get_record', '5.3', [714], '5.2'], - ['dbase_numfields', '5.3', [715], '5.2'], - ['dbase_numrecords', '5.3', [716], '5.2'], - ['dbase_open', '5.3', [717], '5.2'], - ['dbase_pack', '5.3', [718], '5.2'], - ['dbase_replace_record', '5.3', [719], '5.2'], - ['fbsql_affected_rows', '5.3', [728], '5.2'], - ['fbsql_autocommit', '5.3', [729], '5.2'], - ['fbsql_blob_size', '5.3', [730], '5.2'], - ['fbsql_change_user', '5.3', [731], '5.2'], - ['fbsql_clob_size', '5.3', [732], '5.2'], - ['fbsql_close', '5.3', [733], '5.2'], - ['fbsql_commit', '5.3', [734], '5.2'], - ['fbsql_connect', '5.3', [735], '5.2'], - ['fbsql_create_blob', '5.3', [736], '5.2'], - ['fbsql_create_clob', '5.3', [737], '5.2'], - ['fbsql_create_db', '5.3', [738], '5.2'], - ['fbsql_data_seek', '5.3', [739], '5.2'], - ['fbsql_database_password', '5.3', [740], '5.2'], - ['fbsql_database', '5.3', [741], '5.2'], - ['fbsql_db_query', '5.3', [742], '5.2'], - ['fbsql_db_status', '5.3', [743], '5.2'], - ['fbsql_drop_db', '5.3', [744], '5.2'], - ['fbsql_errno', '5.3', [745], '5.2'], - ['fbsql_error', '5.3', [746], '5.2'], - ['fbsql_fetch_array', '5.3', [747], '5.2'], - ['fbsql_fetch_assoc', '5.3', [748], '5.2'], - ['fbsql_fetch_field', '5.3', [749], '5.2'], - ['fbsql_fetch_lengths', '5.3', [750], '5.2'], - ['fbsql_fetch_object', '5.3', [751], '5.2'], - ['fbsql_fetch_row', '5.3', [752], '5.2'], - ['fbsql_field_flags', '5.3', [753], '5.2'], - ['fbsql_field_len', '5.3', [754], '5.2'], - ['fbsql_field_name', '5.3', [755], '5.2'], - ['fbsql_field_seek', '5.3', [756], '5.2'], - ['fbsql_field_table', '5.3', [757], '5.2'], - ['fbsql_field_type', '5.3', [758], '5.2'], - ['fbsql_free_result', '5.3', [759], '5.2'], - ['fbsql_get_autostart_info', '5.3', [760], '5.2'], - ['fbsql_hostname', '5.3', [761], '5.2'], - ['fbsql_insert_id', '5.3', [762], '5.2'], - ['fbsql_list_dbs', '5.3', [763], '5.2'], - ['fbsql_list_fields', '5.3', [764], '5.2'], - ['fbsql_list_tables', '5.3', [765], '5.2'], - ['fbsql_next_result', '5.3', [766], '5.2'], - ['fbsql_num_fields', '5.3', [767], '5.2'], - ['fbsql_num_rows', '5.3', [768], '5.2'], - ['fbsql_password', '5.3', [769], '5.2'], - ['fbsql_pconnect', '5.3', [770], '5.2'], - ['fbsql_query', '5.3', [771], '5.2'], - ['fbsql_read_blob', '5.3', [772], '5.2'], - ['fbsql_read_clob', '5.3', [773], '5.2'], - ['fbsql_result', '5.3', [774], '5.2'], - ['fbsql_rollback', '5.3', [775], '5.2'], - ['fbsql_rows_fetched', '5.3', [776], '5.2'], - ['fbsql_select_db', '5.3', [777], '5.2'], - ['fbsql_set_characterset', '5.3', [778], '5.2'], - ['fbsql_set_lob_mode', '5.3', [779], '5.2'], - ['fbsql_set_password', '5.3', [780], '5.2'], - ['fbsql_set_transaction', '5.3', [781], '5.2'], - ['fbsql_start_db', '5.3', [782], '5.2'], - ['fbsql_stop_db', '5.3', [783], '5.2'], - ['fbsql_table_name', '5.3', [784], '5.2'], - ['fbsql_tablename', '5.3', [785], '5.2'], - ['fbsql_username', '5.3', [786], '5.2'], - ['fbsql_warnings', '5.3', [787], '5.2'], - ['msql_affected_rows', '5.3', [813], '5.2'], - ['msql_close', '5.3', [814], '5.2'], - ['msql_connect', '5.3', [815], '5.2'], - ['msql_create_db', '5.3', [816], '5.2'], - ['msql_createdb', '5.3', [817], '5.2'], - ['msql_data_seek', '5.3', [818], '5.2'], - ['msql_db_query', '5.3', [819], '5.2'], - ['msql_dbname', '5.3', [820], '5.2'], - ['msql_drop_db', '5.3', [821], '5.2'], - ['msql_error', '5.3', [822], '5.2'], - ['msql_fetch_array', '5.3', [823], '5.2'], - ['msql_fetch_field', '5.3', [824], '5.2'], - ['msql_fetch_object', '5.3', [825], '5.2'], - ['msql_fetch_row', '5.3', [826], '5.2'], - ['msql_field_flags', '5.3', [827], '5.2'], - ['msql_field_len', '5.3', [828], '5.2'], - ['msql_field_name', '5.3', [829], '5.2'], - ['msql_field_seek', '5.3', [830], '5.2'], - ['msql_field_table', '5.3', [831], '5.2'], - ['msql_field_type', '5.3', [832], '5.2'], - ['msql_fieldflags', '5.3', [833], '5.2'], - ['msql_fieldlen', '5.3', [834], '5.2'], - ['msql_fieldname', '5.3', [835], '5.2'], - ['msql_fieldtable', '5.3', [836], '5.2'], - ['msql_fieldtype', '5.3', [837], '5.2'], - ['msql_free_result', '5.3', [838], '5.2'], - ['msql_list_dbs', '5.3', [839], '5.2'], - ['msql_list_fields', '5.3', [840], '5.2'], - ['msql_list_tables', '5.3', [841], '5.2'], - ['msql_num_fields', '5.3', [842], '5.2'], - ['msql_num_rows', '5.3', [843], '5.2'], - ['msql_numfields', '5.3', [844], '5.2'], - ['msql_numrows', '5.3', [845], '5.2'], - ['msql_pconnect', '5.3', [846], '5.2'], - ['msql_query', '5.3', [847], '5.2'], - ['msql_regcase', '5.3', [848], '5.2'], - ['msql_result', '5.3', [849], '5.2'], - ['msql_select_db', '5.3', [850], '5.2'], - ['msql_tablename', '5.3', [851], '5.2'], - ['msql', '5.3', [852], '5.2'], - ['mysqli_disable_reads_from_master', '5.3', [1144], '5.2'], - ['mysqli_disable_rpl_parse', '5.3', [1145], '5.2'], - ['mysqli_enable_reads_from_master', '5.3', [1149], '5.2'], - ['mysqli_enable_rpl_parse', '5.3', [1150], '5.2'], - ['mysqli_master_query', '5.3', [1151], '5.2'], - ['mysqli_rpl_parse_enabled', '5.3', [1153], '5.2'], - ['mysqli_rpl_probe', '5.3', [1154], '5.2'], - ['mysqli_slave_query', '5.3', [1157], '5.2'], - - ['sqlite_array_query', '5.4', [883], '5.3'], - ['sqlite_busy_timeout', '5.4', [884], '5.3'], - ['sqlite_changes', '5.4', [885], '5.3'], - ['sqlite_close', '5.4', [886], '5.3'], - ['sqlite_column', '5.4', [887], '5.3'], - ['sqlite_create_aggregate', '5.4', [888], '5.3'], - ['sqlite_create_function', '5.4', [889], '5.3'], - ['sqlite_current', '5.4', [890], '5.3'], - ['sqlite_error_string', '5.4', [891], '5.3'], - ['sqlite_escape_string', '5.4', [892], '5.3'], - ['sqlite_exec', '5.4', [893], '5.3'], - ['sqlite_factory', '5.4', [894], '5.3'], - ['sqlite_fetch_all', '5.4', [895], '5.3'], - ['sqlite_fetch_array', '5.4', [896], '5.3'], - ['sqlite_fetch_column_types', '5.4', [897], '5.3'], - ['sqlite_fetch_object', '5.4', [898], '5.3'], - ['sqlite_fetch_single', '5.4', [899], '5.3'], - ['sqlite_fetch_string', '5.4', [900], '5.3'], - ['sqlite_field_name', '5.4', [901], '5.3'], - ['sqlite_has_more', '5.4', [902], '5.3'], - ['sqlite_has_prev', '5.4', [903], '5.3'], - ['sqlite_key', '5.4', [904], '5.3'], - ['sqlite_last_error', '5.4', [905], '5.3'], - ['sqlite_last_insert_rowid', '5.4', [906], '5.3'], - ['sqlite_libencoding', '5.4', [907], '5.3'], - ['sqlite_libversion', '5.4', [908], '5.3'], - ['sqlite_next', '5.4', [909], '5.3'], - ['sqlite_num_fields', '5.4', [910], '5.3'], - ['sqlite_num_rows', '5.4', [911], '5.3'], - ['sqlite_open', '5.4', [912], '5.3'], - ['sqlite_popen', '5.4', [913], '5.3'], - ['sqlite_prev', '5.4', [914], '5.3'], - ['sqlite_query', '5.4', [915], '5.3'], - ['sqlite_rewind', '5.4', [916], '5.3'], - ['sqlite_seek', '5.4', [917], '5.3'], - ['sqlite_single_query', '5.4', [918], '5.3'], - ['sqlite_udf_decode_binary', '5.4', [919], '5.3'], - ['sqlite_udf_encode_binary', '5.4', [920], '5.3'], - ['sqlite_unbuffered_query', '5.4', [921], '5.3'], - ['sqlite_valid', '5.4', [922], '5.3'], - - ['php_logo_guid', '5.5', [32], '5.4'], - ['php_egg_logo_guid', '5.5', [33], '5.4'], - ['php_real_logo_guid', '5.5', [34], '5.4'], - ['imagepsbbox', '7.0', [90], '5.6'], - ['imagepsencodefont', '7.0', [91], '5.6'], - ['imagepsextendfont', '7.0', [92], '5.6'], - ['imagepsfreefont', '7.0', [93], '5.6'], - ['imagepsloadfont', '7.0', [94], '5.6'], - ['imagepsslantfont', '7.0', [95], '5.6'], - ['imagepstext', '7.0', [96], '5.6'], - ['mssql_bind', '7.0', [853], '5.6'], - ['mssql_close', '7.0', [854], '5.6'], - ['mssql_connect', '7.0', [855], '5.6'], - ['mssql_data_seek', '7.0', [856], '5.6'], - ['mssql_execute', '7.0', [857], '5.6'], - ['mssql_fetch_array', '7.0', [858], '5.6'], - ['mssql_fetch_assoc', '7.0', [859], '5.6'], - ['mssql_fetch_batch', '7.0', [860], '5.6'], - ['mssql_fetch_field', '7.0', [861], '5.6'], - ['mssql_fetch_object', '7.0', [862], '5.6'], - ['mssql_fetch_row', '7.0', [863], '5.6'], - ['mssql_field_length', '7.0', [864], '5.6'], - ['mssql_field_name', '7.0', [865], '5.6'], - ['mssql_field_seek', '7.0', [866], '5.6'], - ['mssql_field_type', '7.0', [867], '5.6'], - ['mssql_free_result', '7.0', [868], '5.6'], - ['mssql_free_statement', '7.0', [869], '5.6'], - ['mssql_get_last_message', '7.0', [870], '5.6'], - ['mssql_guid_string', '7.0', [871], '5.6'], - ['mssql_init', '7.0', [872], '5.6'], - ['mssql_min_error_severity', '7.0', [873], '5.6'], - ['mssql_min_message_severity', '7.0', [874], '5.6'], - ['mssql_next_result', '7.0', [875], '5.6'], - ['mssql_num_fields', '7.0', [876], '5.6'], - ['mssql_num_rows', '7.0', [877], '5.6'], - ['mssql_pconnect', '7.0', [878], '5.6'], - ['mssql_query', '7.0', [879], '5.6'], - ['mssql_result', '7.0', [880], '5.6'], - ['mssql_rows_affected', '7.0', [881], '5.6'], - ['mssql_select_db', '7.0', [882], '5.6'], - ['sybase_affected_rows', '7.0', [1081], '5.6'], - ['sybase_close', '7.0', [1082], '5.6'], - ['sybase_connect', '7.0', [1083], '5.6'], - ['sybase_data_seek', '7.0', [1084], '5.6'], - ['sybase_deadlock_retry_count', '7.0', [1085], '5.6'], - ['sybase_fetch_array', '7.0', [1086], '5.6'], - ['sybase_fetch_assoc', '7.0', [1087], '5.6'], - ['sybase_fetch_field', '7.0', [1088], '5.6'], - ['sybase_fetch_object', '7.0', [1089], '5.6'], - ['sybase_fetch_row', '7.0', [1090], '5.6'], - ['sybase_field_seek', '7.0', [1091], '5.6'], - ['sybase_free_result', '7.0', [1092], '5.6'], - ['sybase_get_last_message', '7.0', [1093], '5.6'], - ['sybase_min_client_severity', '7.0', [1094], '5.6'], - ['sybase_min_error_severity', '7.0', [1095], '5.6'], - ['sybase_min_message_severity', '7.0', [1096], '5.6'], - ['sybase_min_server_severity', '7.0', [1097], '5.6'], - ['sybase_num_fields', '7.0', [1098], '5.6'], - ['sybase_num_rows', '7.0', [1099], '5.6'], - ['sybase_pconnect', '7.0', [1100], '5.6'], - ['sybase_query', '7.0', [1101], '5.6'], - ['sybase_result', '7.0', [1102], '5.6'], - ['sybase_select_db', '7.0', [1103], '5.6'], - ['sybase_set_message_handler', '7.0', [1104], '5.6'], - ['sybase_unbuffered_query', '7.0', [1105], '5.6'], - - ['php_check_syntax', '5.0.5', [98], '5.0', '5.1'], - ['mysqli_get_cache_stats', '5.4', [99], '5.3'], - ['ibase_add_user', '7.4', [171], '7.3'], - ['ibase_affected_rows', '7.4', [172], '7.3'], - ['ibase_backup', '7.4', [173], '7.3'], - ['ibase_blob_add', '7.4', [174], '7.3'], - ['ibase_blob_cancel', '7.4', [175], '7.3'], - ['ibase_blob_close', '7.4', [176], '7.3'], - ['ibase_blob_create', '7.4', [177], '7.3'], - ['ibase_blob_echo', '7.4', [178], '7.3'], - ['ibase_blob_get', '7.4', [179], '7.3'], - ['ibase_blob_import', '7.4', [180], '7.3'], - ['ibase_blob_info', '7.4', [181], '7.3'], - ['ibase_blob_open', '7.4', [182], '7.3'], - ['ibase_close', '7.4', [183], '7.3'], - ['ibase_commit_ret', '7.4', [184], '7.3'], - ['ibase_commit', '7.4', [185], '7.3'], - ['ibase_connect', '7.4', [186], '7.3'], - ['ibase_db_info', '7.4', [187], '7.3'], - ['ibase_delete_user', '7.4', [188], '7.3'], - ['ibase_drop_db', '7.4', [189], '7.3'], - ['ibase_errcode', '7.4', [190], '7.3'], - ['ibase_errmsg', '7.4', [191], '7.3'], - ['ibase_execute', '7.4', [192], '7.3'], - ['ibase_fetch_assoc', '7.4', [193], '7.3'], - ['ibase_fetch_object', '7.4', [194], '7.3'], - ['ibase_fetch_row', '7.4', [195], '7.3'], - ['ibase_field_info', '7.4', [196], '7.3'], - ['ibase_free_event_handler', '7.4', [197], '7.3'], - ['ibase_free_query', '7.4', [198], '7.3'], - ['ibase_free_result', '7.4', [199], '7.3'], - ['ibase_gen_id', '7.4', [200], '7.3'], - ['ibase_maintain_db', '7.4', [201], '7.3'], - ['ibase_modify_user', '7.4', [202], '7.3'], - ['ibase_name_result', '7.4', [203], '7.3'], - ['ibase_num_fields', '7.4', [204], '7.3'], - ['ibase_num_params', '7.4', [205], '7.3'], - ['ibase_param_info', '7.4', [206], '7.3'], - ['ibase_pconnect', '7.4', [207], '7.3'], - ['ibase_prepare', '7.4', [208], '7.3'], - ['ibase_query', '7.4', [209], '7.3'], - ['ibase_restore', '7.4', [210], '7.3'], - ['ibase_rollback_ret', '7.4', [211], '7.3'], - ['ibase_rollback', '7.4', [212], '7.3'], - ['ibase_server_info', '7.4', [213], '7.3'], - ['ibase_service_attach', '7.4', [214], '7.3'], - ['ibase_service_detach', '7.4', [215], '7.3'], - ['ibase_set_event_handler', '7.4', [216], '7.3'], - ['ibase_trans', '7.4', [217], '7.3'], - ['ibase_wait_event', '7.4', [218], '7.3'], - ['fbird_add_user', '7.4', [987], '7.3'], - ['fbird_affected_rows', '7.4', [988], '7.3'], - ['fbird_backup', '7.4', [989], '7.3'], - ['fbird_blob_add', '7.4', [990], '7.3'], - ['fbird_blob_cancel', '7.4', [991], '7.3'], - ['fbird_blob_close', '7.4', [992], '7.3'], - ['fbird_blob_create', '7.4', [993], '7.3'], - ['fbird_blob_echo', '7.4', [994], '7.3'], - ['fbird_blob_get', '7.4', [995], '7.3'], - ['fbird_blob_import', '7.4', [996], '7.3'], - ['fbird_blob_info', '7.4', [997], '7.3'], - ['fbird_blob_open', '7.4', [998], '7.3'], - ['fbird_close', '7.4', [999], '7.3'], - ['fbird_commit_ret', '7.4', [1000], '7.3'], - ['fbird_commit', '7.4', [1001], '7.3'], - ['fbird_connect', '7.4', [1002], '7.3'], - ['fbird_db_info', '7.4', [1003], '7.3'], - ['fbird_delete_user', '7.4', [1004], '7.3'], - ['fbird_drop_db', '7.4', [1005], '7.3'], - ['fbird_errcode', '7.4', [1006], '7.3'], - ['fbird_errmsg', '7.4', [1007], '7.3'], - ['fbird_execute', '7.4', [1008], '7.3'], - ['fbird_fetch_assoc', '7.4', [1009], '7.3'], - ['fbird_fetch_object', '7.4', [1010], '7.3'], - ['fbird_fetch_row', '7.4', [1011], '7.3'], - ['fbird_field_info', '7.4', [1012], '7.3'], - ['fbird_free_event_handler', '7.4', [1013], '7.3'], - ['fbird_free_query', '7.4', [1014], '7.3'], - ['fbird_free_result', '7.4', [1015], '7.3'], - ['fbird_gen_id', '7.4', [1016], '7.3'], - ['fbird_maintain_db', '7.4', [1017], '7.3'], - ['fbird_modify_user', '7.4', [1018], '7.3'], - ['fbird_name_result', '7.4', [1019], '7.3'], - ['fbird_num_fields', '7.4', [1020], '7.3'], - ['fbird_num_params', '7.4', [1021], '7.3'], - ['fbird_param_info', '7.4', [1022], '7.3'], - ['fbird_pconnect', '7.4', [1023], '7.3'], - ['fbird_prepare', '7.4', [1024], '7.3'], - ['fbird_query', '7.4', [1025], '7.3'], - ['fbird_restore', '7.4', [1026], '7.3'], - ['fbird_rollback_ret', '7.4', [1027], '7.3'], - ['fbird_rollback', '7.4', [1028], '7.3'], - ['fbird_server_info', '7.4', [1029], '7.3'], - ['fbird_service_attach', '7.4', [1030], '7.3'], - ['fbird_service_detach', '7.4', [1031], '7.3'], - ['fbird_set_event_handler', '7.4', [1032], '7.3'], - ['fbird_trans', '7.4', [1033], '7.3'], - ['fbird_wait_event', '7.4', [1034], '7.3'], - - ['wddx_add_vars', '7.4', [228], '7.3'], - ['wddx_deserialize', '7.4', [229], '7.3'], - ['wddx_packet_end', '7.4', [230], '7.3'], - ['wddx_packet_start', '7.4', [231], '7.3'], - ['wddx_serialize_value', '7.4', [232], '7.3'], - ['wddx_serialize_vars', '7.4', [233], '7.3'], - ['mysqli_embedded_server_end', '7.4', [1147], '7.3'], - ['mysqli_embedded_server_start', '7.4', [1148], '7.3'], - - ['oci_internal_debug', '8.0', [1178], '7.4'], - ['xmlrpc_decode_request', '8.0', [1158], '7.4'], - ['xmlrpc_decode', '8.0', [1159], '7.4'], - ['xmlrpc_encode_request', '8.0', [1160], '7.4'], - ['xmlrpc_encode', '8.0', [1161], '7.4'], - ['xmlrpc_get_type', '8.0', [1162], '7.4'], - ['xmlrpc_is_fault', '8.0', [1163], '7.4'], - ['xmlrpc_parse_method_descriptions', '8.0', [1164], '7.4'], - ['xmlrpc_server_add_introspection_data', '8.0', [1165], '7.4'], - ['xmlrpc_server_call_method', '8.0', [1166], '7.4'], - ['xmlrpc_server_create', '8.0', [1167], '7.4'], - ['xmlrpc_server_destroy', '8.0', [1168], '7.4'], - ['xmlrpc_server_register_introspection_callback', '8.0', [1169], '7.4'], - ['xmlrpc_server_register_method', '8.0', [1170], '7.4'], - ['xmlrpc_set_type', '8.0', [1171], '7.4'], - ]; - } - - - /** - * testRemovedFunctionWithAlternative - * - * @dataProvider dataRemovedFunctionWithAlternative - * - * @param string $functionName Name of the function. - * @param string $removedIn The PHP version in which the function was removed. - * @param string $alternative An alternative function. - * @param array $lines The line numbers in the test file which apply to this function. - * @param string $okVersion A PHP version in which the function was still valid. - * @param string $removedVersion Optional PHP version to test removed message with - - * if different from the $removedIn version. - * - * @return void - */ - public function testRemovedFunctionWithAlternative($functionName, $removedIn, $alternative, $lines, $okVersion, $removedVersion = null) - { - $file = $this->sniffFile(__FILE__, $okVersion); - foreach ($lines as $line) { - $this->assertNoViolation($file, $line); - } - - $errorVersion = (isset($removedVersion)) ? $removedVersion : $removedIn; - $file = $this->sniffFile(__FILE__, $errorVersion); - $error = "Function {$functionName}() is removed since PHP {$removedIn}; Use {$alternative} instead"; - foreach ($lines as $line) { - $this->assertError($file, $line, $error); - } - } - - /** - * Data provider. - * - * @see testRemovedFunctionWithAlternative() - * - * @return array - */ - public function dataRemovedFunctionWithAlternative() - { - return [ - ['zend_logo_guid', '5.5', 'text string "PHPE9568F35-D428-11d2-A769-00AA001ACF42"', [35], '5.4'], - - ['recode_file', '7.4', 'the iconv or mbstring extension', [236], '7.3'], - ['recode_string', '7.4', 'the iconv or mbstring extension', [237], '7.3'], - ['recode', '7.4', 'the iconv or mbstring extension', [238], '7.3'], - - ['imap_header', '8.0', 'imap_headerinfo()', [1216], '7.4'], - ]; - } - - - /** - * testDeprecatedRemovedFunction - * - * @dataProvider dataDeprecatedRemovedFunction - * - * @param string $functionName Name of the function. - * @param string $deprecatedIn The PHP version in which the function was deprecated. - * @param string $removedIn The PHP version in which the function was removed. - * @param array $lines The line numbers in the test file which apply to this function. - * @param string $okVersion A PHP version in which the function was still valid. - * @param string $deprecatedVersion Optional PHP version to test deprecation message with - - * if different from the $deprecatedIn version. - * @param string $removedVersion Optional PHP version to test removed message with - - * if different from the $removedIn version. - * - * @return void - */ - public function testDeprecatedRemovedFunction($functionName, $deprecatedIn, $removedIn, $lines, $okVersion, $deprecatedVersion = null, $removedVersion = null) - { - $file = $this->sniffFile(__FILE__, $okVersion); - foreach ($lines as $line) { - $this->assertNoViolation($file, $line); - } - - $errorVersion = (isset($deprecatedVersion)) ? $deprecatedVersion : $deprecatedIn; - $file = $this->sniffFile(__FILE__, $errorVersion); - $error = "Function {$functionName}() is deprecated since PHP {$deprecatedIn}"; - foreach ($lines as $line) { - $this->assertWarning($file, $line, $error); - } - - $errorVersion = (isset($removedVersion)) ? $removedVersion : $removedIn; - $file = $this->sniffFile(__FILE__, $errorVersion); - $error = "Function {$functionName}() is deprecated since PHP {$deprecatedIn} and removed since PHP {$removedIn}"; - foreach ($lines as $line) { - $this->assertError($file, $line, $error); - } - } - - /** - * Data provider. - * - * @see testDeprecatedRemovedFunction() - * - * @return array - */ - public function dataDeprecatedRemovedFunction() - { - return [ - ['define_syslog_variables', '5.3', '5.4', [5], '5.2'], - ['import_request_variables', '5.3', '5.4', [11], '5.2'], - ['mysql_list_dbs', '5.4', '7.0', [15], '5.3'], - ['magic_quotes_runtime', '5.3', '7.0', [23], '5.2'], - ['set_magic_quotes_runtime', '5.3', '7.0', [27], '5.2'], - ['sql_regcase', '5.3', '7.0', [31], '5.2'], - ['mysql_affected_rows', '5.5', '7.0', [923], '5.4'], - ['mysql_client_encoding', '5.5', '7.0', [924], '5.4'], - ['mysql_close', '5.5', '7.0', [925], '5.4'], - ['mysql_connect', '5.5', '7.0', [926], '5.4'], - ['mysql_create_db', '4.3', '7.0', [927], '4.2'], - ['mysql_data_seek', '5.5', '7.0', [928], '5.4'], - ['mysql_db_name', '5.5', '7.0', [929], '5.4'], - ['mysql_drop_db', '4.3', '7.0', [930], '4.2'], - ['mysql_errno', '5.5', '7.0', [931], '5.4'], - ['mysql_error', '5.5', '7.0', [932], '5.4'], - ['mysql_fetch_array', '5.5', '7.0', [933], '5.4'], - ['mysql_fetch_assoc', '5.5', '7.0', [934], '5.4'], - ['mysql_fetch_field', '5.5', '7.0', [935], '5.4'], - ['mysql_fetch_lengths', '5.5', '7.0', [936], '5.4'], - ['mysql_fetch_object', '5.5', '7.0', [937], '5.4'], - ['mysql_fetch_row', '5.5', '7.0', [938], '5.4'], - ['mysql_field_flags', '5.5', '7.0', [939], '5.4'], - ['mysql_field_len', '5.5', '7.0', [940], '5.4'], - ['mysql_field_name', '5.5', '7.0', [941], '5.4'], - ['mysql_field_seek', '5.5', '7.0', [942], '5.4'], - ['mysql_field_table', '5.5', '7.0', [943], '5.4'], - ['mysql_field_type', '5.5', '7.0', [944], '5.4'], - ['mysql_free_result', '5.5', '7.0', [945], '5.4'], - ['mysql_get_client_info', '5.5', '7.0', [946], '5.4'], - ['mysql_get_host_info', '5.5', '7.0', [947], '5.4'], - ['mysql_get_proto_info', '5.5', '7.0', [948], '5.4'], - ['mysql_get_server_info', '5.5', '7.0', [949], '5.4'], - ['mysql_info', '5.5', '7.0', [950], '5.4'], - ['mysql_insert_id', '5.5', '7.0', [951], '5.4'], - ['mysql_list_fields', '5.4', '7.0', [952], '5.3'], - ['mysql_list_processes', '5.5', '7.0', [953], '5.4'], - ['mysql_list_tables', '4.3.7', '7.0', [954], '4.3', '4.4'], - ['mysql_num_fields', '5.5', '7.0', [955], '5.4'], - ['mysql_num_rows', '5.5', '7.0', [956], '5.4'], - ['mysql_pconnect', '5.5', '7.0', [957], '5.4'], - ['mysql_ping', '5.5', '7.0', [958], '5.4'], - ['mysql_query', '5.5', '7.0', [959], '5.4'], - ['mysql_real_escape_string', '5.5', '7.0', [960], '5.4'], - ['mysql_result', '5.5', '7.0', [961], '5.4'], - ['mysql_select_db', '5.5', '7.0', [962], '5.4'], - ['mysql_set_charset', '5.5', '7.0', [963], '5.4'], - ['mysql_stat', '5.5', '7.0', [964], '5.4'], - ['mysql_tablename', '5.5', '7.0', [965], '5.4'], - ['mysql_thread_id', '5.5', '7.0', [966], '5.4'], - ['mysql_unbuffered_query', '5.5', '7.0', [967], '5.4'], - ['mysql', '5.5', '7.0', [968], '5.4'], - ['mysql_fieldname', '5.5', '7.0', [969], '5.4'], - ['mysql_fieldtable', '5.5', '7.0', [970], '5.4'], - ['mysql_fieldlen', '5.5', '7.0', [971], '5.4'], - ['mysql_fieldtype', '5.5', '7.0', [972], '5.4'], - ['mysql_fieldflags', '5.5', '7.0', [973], '5.4'], - ['mysql_selectdb', '5.5', '7.0', [974], '5.4'], - ['mysql_freeresult', '5.5', '7.0', [977], '5.4'], - ['mysql_numfields', '5.5', '7.0', [978], '5.4'], - ['mysql_numrows', '5.5', '7.0', [979], '5.4'], - ['mysql_listdbs', '5.5', '7.0', [980], '5.4'], - ['mysql_listfields', '5.5', '7.0', [982], '5.4'], - ['mysql_dbname', '5.5', '7.0', [983], '5.4'], - ['mysql_table_name', '5.5', '7.0', [984], '5.4'], - - ['ldap_sort', '7.0', '8.0', [97], '5.6'], - ['fgetss', '7.3', '8.0', [167], '7.2'], - ['gzgetss', '7.3', '8.0', [168], '7.2'], - ['ezmlm_hash', '7.4', '8.0', [245], '7.3'], - ['get_magic_quotes_gpc', '7.4', '8.0', [240], '7.3'], - ['get_magic_quotes_runtime', '7.4', '8.0', [241], '7.3'], - ['hebrevc', '7.4', '8.0', [242], '7.3'], - ]; - } - - - /** - * testDeprecatedRemovedFunctionWithAlternative - * - * @dataProvider dataDeprecatedRemovedFunctionWithAlternative - * - * @param string $functionName Name of the function. - * @param string $deprecatedIn The PHP version in which the function was deprecated. - * @param string $removedIn The PHP version in which the function was removed. - * @param string $alternative An alternative function. - * @param array $lines The line numbers in the test file which apply to this function. - * @param string $okVersion A PHP version in which the function was still valid. - * @param string $deprecatedVersion Optional PHP version to test deprecation message with - - * if different from the $deprecatedIn version. - * @param string $removedVersion Optional PHP version to test removed message with - - * if different from the $removedIn version. - * - * @return void - */ - public function testDeprecatedRemovedFunctionWithAlternative($functionName, $deprecatedIn, $removedIn, $alternative, $lines, $okVersion, $deprecatedVersion = null, $removedVersion = null) - { - $file = $this->sniffFile(__FILE__, $okVersion); - foreach ($lines as $line) { - $this->assertNoViolation($file, $line); - } - - $errorVersion = (isset($deprecatedVersion)) ? $deprecatedVersion : $deprecatedIn; - $file = $this->sniffFile(__FILE__, $errorVersion); - $error = "Function {$functionName}() is deprecated since PHP {$deprecatedIn}; Use {$alternative} instead"; - foreach ($lines as $line) { - $this->assertWarning($file, $line, $error); - } - - $errorVersion = (isset($removedVersion)) ? $removedVersion : $removedIn; - $file = $this->sniffFile(__FILE__, $errorVersion); - $error = "Function {$functionName}() is deprecated since PHP {$deprecatedIn} and removed since PHP {$removedIn}; Use {$alternative} instead"; - foreach ($lines as $line) { - $this->assertError($file, $line, $error); - } - } - - /** - * Data provider. - * - * @see testDeprecatedRemovedFunctionWithAlternative() - * - * @return array - */ - public function dataDeprecatedRemovedFunctionWithAlternative() - { - return [ - ['call_user_method', '4.1', '7.0', 'call_user_func()', [3], '4.0'], - ['call_user_method_array', '4.1', '7.0', 'call_user_func_array()', [4], '4.0'], - ['ereg', '5.3', '7.0', 'preg_match()', [7], '5.2'], - ['ereg_replace', '5.3', '7.0', 'preg_replace()', [8], '5.2'], - ['eregi', '5.3', '7.0', 'preg_match() (with the i modifier)', [9], '5.2'], - ['eregi_replace', '5.3', '7.0', 'preg_replace() (with the i modifier)', [10], '5.2'], - ['mcrypt_generic_end', '5.3', '7.0', 'mcrypt_generic_deinit()', [12], '5.2'], - ['mcrypt_ecb', '5.5', '7.0', 'mcrypt_decrypt()/mcrypt_encrypt()', [37], '5.4'], - ['mcrypt_cbc', '5.5', '7.0', 'mcrypt_decrypt()/mcrypt_encrypt()', [38], '5.4'], - ['mcrypt_cfb', '5.5', '7.0', 'mcrypt_decrypt()/mcrypt_encrypt()', [39], '5.4'], - ['mcrypt_ofb', '5.5', '7.0', 'mcrypt_decrypt()/mcrypt_encrypt()', [40], '5.4'], - ['mysql_db_query', '5.3', '7.0', 'mysqli::select_db() and mysqli::query()', [13], '5.2'], - ['mysql_escape_string', '4.3', '7.0', 'mysqli::real_escape_string()', [14], '4.2'], - ['mysqli_bind_param', '5.3', '5.4', 'mysqli_stmt::bind_param()', [16], '5.2'], - ['mysqli_bind_result', '5.3', '5.4', 'mysqli_stmt::bind_result()', [17], '5.2'], - ['mysqli_client_encoding', '5.3', '5.4', 'mysqli::character_set_name()', [18], '5.2'], - ['mysqli_fetch', '5.3', '5.4', 'mysqli_stmt::fetch()', [19], '5.2'], - ['mysqli_param_count', '5.3', '5.4', 'mysqli_stmt_param_count()', [20], '5.2'], - ['mysqli_get_metadata', '5.3', '5.4', 'mysqli_stmt::result_metadata()', [21], '5.2'], - ['mysqli_send_long_data', '5.3', '5.4', 'mysqli_stmt::send_long_data()', [22], '5.2'], - ['session_register', '5.3', '5.4', '$_SESSION', [24], '5.2'], - ['session_unregister', '5.3', '5.4', '$_SESSION', [25], '5.2'], - ['session_is_registered', '5.3', '5.4', '$_SESSION', [26], '5.2'], - ['set_socket_blocking', '5.3', '7.0', 'stream_set_blocking()', [28], '5.2'], - ['split', '5.3', '7.0', 'preg_split(), explode() or str_split()', [29], '5.2'], - ['spliti', '5.3', '7.0', 'preg_split() (with the i modifier)', [30], '5.2'], - ['datefmt_set_timezone_id', '5.5', '7.0', 'IntlDateFormatter::setTimeZone()', [36], '5.4'], - - ['mcrypt_create_iv', '7.1', '7.2', 'random_bytes() or OpenSSL', [100], '7.0'], - ['mcrypt_decrypt', '7.1', '7.2', 'OpenSSL', [101], '7.0'], - ['mcrypt_enc_get_algorithms_name', '7.1', '7.2', 'OpenSSL', [102], '7.0'], - ['mcrypt_enc_get_block_size', '7.1', '7.2', 'OpenSSL', [103], '7.0'], - ['mcrypt_enc_get_iv_size', '7.1', '7.2', 'OpenSSL', [104], '7.0'], - ['mcrypt_enc_get_key_size', '7.1', '7.2', 'OpenSSL', [105], '7.0'], - ['mcrypt_enc_get_modes_name', '7.1', '7.2', 'OpenSSL', [106], '7.0'], - ['mcrypt_enc_get_supported_key_sizes', '7.1', '7.2', 'OpenSSL', [107], '7.0'], - ['mcrypt_enc_is_block_algorithm_mode', '7.1', '7.2', 'OpenSSL', [108], '7.0'], - ['mcrypt_enc_is_block_algorithm', '7.1', '7.2', 'OpenSSL', [109], '7.0'], - ['mcrypt_enc_is_block_mode', '7.1', '7.2', 'OpenSSL', [110], '7.0'], - ['mcrypt_enc_self_test', '7.1', '7.2', 'OpenSSL', [111], '7.0'], - ['mcrypt_encrypt', '7.1', '7.2', 'OpenSSL', [112], '7.0'], - ['mcrypt_generic_deinit', '7.1', '7.2', 'OpenSSL', [113], '7.0'], - ['mcrypt_generic_init', '7.1', '7.2', 'OpenSSL', [114], '7.0'], - ['mcrypt_generic', '7.1', '7.2', 'OpenSSL', [115], '7.0'], - ['mcrypt_get_block_size', '7.1', '7.2', 'OpenSSL', [116], '7.0'], - ['mcrypt_get_cipher_name', '7.1', '7.2', 'OpenSSL', [117], '7.0'], - ['mcrypt_get_iv_size', '7.1', '7.2', 'OpenSSL', [118], '7.0'], - ['mcrypt_get_key_size', '7.1', '7.2', 'OpenSSL', [119], '7.0'], - ['mcrypt_list_algorithms', '7.1', '7.2', 'OpenSSL', [120], '7.0'], - ['mcrypt_list_modes', '7.1', '7.2', 'OpenSSL', [121], '7.0'], - ['mcrypt_module_close', '7.1', '7.2', 'OpenSSL', [122], '7.0'], - ['mcrypt_module_get_algo_block_size', '7.1', '7.2', 'OpenSSL', [123], '7.0'], - ['mcrypt_module_get_algo_key_size', '7.1', '7.2', 'OpenSSL', [124], '7.0'], - ['mcrypt_module_get_supported_key_sizes', '7.1', '7.2', 'OpenSSL', [125], '7.0'], - ['mcrypt_module_is_block_algorithm_mode', '7.1', '7.2', 'OpenSSL', [126], '7.0'], - ['mcrypt_module_is_block_algorithm', '7.1', '7.2', 'OpenSSL', [127], '7.0'], - ['mcrypt_module_is_block_mode', '7.1', '7.2', 'OpenSSL', [128], '7.0'], - ['mcrypt_module_open', '7.1', '7.2', 'OpenSSL', [129], '7.0'], - ['mcrypt_module_self_test', '7.1', '7.2', 'OpenSSL', [130], '7.0'], - ['mdecrypt_generic', '7.1', '7.2', 'OpenSSL', [131], '7.0'], - - ['create_function', '7.2', '8.0', 'an anonymous function', [146], '7.1'], - ['each', '7.2', '8.0', 'a foreach loop or ArrayIterator', [147], '7.1'], - ['read_exif_data', '7.2', '8.0', 'exif_read_data()', [149], '7.1'], - ['jpeg2wbmp', '7.2', '8.0', 'imagecreatefromjpeg() and imagewbmp()', [144], '7.1'], - ['png2wbmp', '7.2', '8.0', 'imagecreatefrompng() or imagewbmp()', [145], '7.1'], - ['gmp_random', '7.2', '8.0', 'gmp_random_bits() or gmp_random_range()', [148], '7.1'], - - ['image2wbmp', '7.3', '8.0', 'imagewbmp()', [152], '7.2'], - ['mbregex_encoding', '7.3', '8.0', 'mb_regex_encoding()', [153], '7.2'], - ['mbereg', '7.3', '8.0', 'mb_ereg()', [154], '7.2'], - ['mberegi', '7.3', '8.0', 'mb_eregi()', [155], '7.2'], - ['mbereg_replace', '7.3', '8.0', 'mb_ereg_replace()', [156], '7.2'], - ['mberegi_replace', '7.3', '8.0', 'mb_eregi_replace()', [157], '7.2'], - ['mbsplit', '7.3', '8.0', 'mb_split()', [158], '7.2'], - ['mbereg_match', '7.3', '8.0', 'mb_ereg_match()', [159], '7.2'], - ['mbereg_search', '7.3', '8.0', 'mb_ereg_search()', [160], '7.2'], - ['mbereg_search_pos', '7.3', '8.0', 'mb_ereg_search_pos()', [161], '7.2'], - ['mbereg_search_regs', '7.3', '8.0', 'mb_ereg_search_regs()', [162], '7.2'], - ['mbereg_search_init', '7.3', '8.0', 'mb_ereg_search_init()', [163], '7.2'], - ['mbereg_search_getregs', '7.3', '8.0', 'mb_ereg_search_getregs()', [164], '7.2'], - ['mbereg_search_getpos', '7.3', '8.0', 'mb_ereg_search_getpos()', [165], '7.2'], - ['mbereg_search_setpos', '7.3', '8.0', 'mb_ereg_search_setpos()', [166], '7.2'], - - ['convert_cyr_string', '7.4', '8.0', 'mb_convert_encoding(), iconv() or UConverter', [243], '7.3'], - ['money_format', '7.4', '8.0', 'NumberFormatter::formatCurrency()', [244], '7.3'], - ['restore_include_path', '7.4', '8.0', "ini_restore('include_path')", [246], '7.3'], - ['ociinternaldebug', '5.4', '8.0', 'oci_internal_debug() (PHP < 8.0)', [69], '5.3'], - ['ldap_control_paged_result_response', '7.4', '8.0', 'ldap_search()', [234], '7.3'], - ['ldap_control_paged_result', '7.4', '8.0', 'ldap_search()', [235], '7.3'], - ]; - } - - - /** - * testNoFalsePositives - * - * @dataProvider dataNoFalsePositives - * - * @param int $line The line number. - * - * @return void - */ - public function testNoFalsePositives($line) - { - $file = $this->sniffFile(__FILE__, '99.0'); // High version beyond latest deprecation. - $this->assertNoViolation($file, $line); - } - - /** - * Data provider. - * - * @see testNoFalsePositives() - * - * @return array - */ - public function dataNoFalsePositives() - { - return [ - [134], - [135], - [136], - [137], - [138], - [139], - [140], - [141], - [249], - [250], - [251], - [252], - [1232], - ]; - } - - - /** - * Verify no notices are thrown at all. - * - * @return void - */ - public function testNoViolationsInFileOnValidVersion() - { - $file = $this->sniffFile(__FILE__, '4.0'); // Low version below the first deprecation. - $this->assertNoViolation($file); - } -} diff --git a/PHPCompatibility/Tests/ParameterValues/ChangedIntToBoolParamTypeUnitTest.inc b/PHPCompatibility/Tests/ParameterValues/ChangedIntToBoolParamTypeUnitTest.inc deleted file mode 100644 index 1690d84c..00000000 --- a/PHPCompatibility/Tests/ParameterValues/ChangedIntToBoolParamTypeUnitTest.inc +++ /dev/null @@ -1,28 +0,0 @@ -sniffFile(__FILE__, $since); - $error = "The {$paramName} parameter of {$functionName}() expects a boolean value instead of an integer since PHP {$since}"; - - $this->assertError($file, $line, $error); - } - - /** - * Data provider. - * - * @see testChangedIntToBoolParamType) - * - * @return array - */ - public function dataChangedIntToBoolParamType() - { - return [ - [21, '8.0', '$auto_release', 'sem_get'], - [22, '8.0', '$auto_release', 'sem_get'], - [23, '8.0', '$auto_release', 'sem_get'], - [24, '8.0', '$auto_release', 'sem_get'], - [25, '8.0', '$auto_release', 'sem_get'], - [26, '8.0', '$auto_release', 'sem_get'], - [27, '8.0', '$enable', 'ob_implicit_flush'], - [28, '8.0', '$enable', 'ob_implicit_flush'], - ]; - } - - - /** - * Verify no false positives are thrown for valid code. - * - * @dataProvider dataNoFalsePositives - * - * @param int $line Line number. - * - * @return void - */ - public function testNoFalsePositives($line) - { - $file = $this->sniffFile(__FILE__, '99.0'); - $this->assertNoViolation($file, $line); - } - - /** - * Data provider. - * - * @see testNoFalsePositives() - * - * @return array - */ - public function dataNoFalsePositives() - { - $data = []; - - // No errors expected on the first 19 lines. - for ($line = 1; $line <= 19; $line++) { - $data[] = [$line]; - } - - return $data; - } - - - /** - * Verify no notices are thrown at all. - * - * @return void - */ - public function testNoViolationsInFileOnValidVersion() - { - $file = $this->sniffFile(__FILE__, '7.4'); // Version before first change. - $this->assertNoViolation($file); - } -} diff --git a/PHPCompatibility/Tests/ParameterValues/RemovedAssertStringAssertionUnitTest.inc b/PHPCompatibility/Tests/ParameterValues/RemovedAssertStringAssertionUnitTest.inc deleted file mode 100644 index 2f0d9d2e..00000000 --- a/PHPCompatibility/Tests/ParameterValues/RemovedAssertStringAssertionUnitTest.inc +++ /dev/null @@ -1,28 +0,0 @@ - 0); -EOT -); -assert( - 'is_int($int)' - . '&& $int > 10' -); diff --git a/PHPCompatibility/Tests/ParameterValues/RemovedAssertStringAssertionUnitTest.php b/PHPCompatibility/Tests/ParameterValues/RemovedAssertStringAssertionUnitTest.php deleted file mode 100644 index fd6326e1..00000000 --- a/PHPCompatibility/Tests/ParameterValues/RemovedAssertStringAssertionUnitTest.php +++ /dev/null @@ -1,91 +0,0 @@ -sniffFile(__FILE__, '7.2'); - $error = 'Using a string as the assertion passed to assert() is deprecated since PHP 7.2'; - $this->assertWarning($file, $line, $error); - - $file = $this->sniffFile(__FILE__, '8.0'); - $error = 'Using a string as the assertion passed to assert() is deprecated since PHP 7.2 and removed since PHP 8.0'; - $this->assertError($file, $line, $error); - } - - /** - * Data provider. - * - * @see testRemovedAssertStringAssertion() - * - * @return array - */ - public function dataRemovedAssertStringAssertion() - { - return [ - [18], - [19], - [20], - [25], - ]; - } - - - /** - * Verify there are no false positives on code this sniff should ignore. - * - * @return void - */ - public function testNoFalsePositives() - { - $file = $this->sniffFile(__FILE__, '7.2'); - - // No errors expected on the first 16 lines. - for ($line = 1; $line <= 16; $line++) { - $this->assertNoViolation($file, $line); - } - } - - /** - * Verify no notices are thrown at all. - * - * @return void - */ - public function testNoViolationsInFileOnValidVersion() - { - $file = $this->sniffFile(__FILE__, '7.1'); - $this->assertNoViolation($file); - } -} diff --git a/PHPCompatibility/Tests/ParameterValues/RemovedGetDefinedFunctionsExcludeDisabledFalseUnitTest.inc b/PHPCompatibility/Tests/ParameterValues/RemovedGetDefinedFunctionsExcludeDisabledFalseUnitTest.inc deleted file mode 100644 index 257e89fd..00000000 --- a/PHPCompatibility/Tests/ParameterValues/RemovedGetDefinedFunctionsExcludeDisabledFalseUnitTest.inc +++ /dev/null @@ -1,11 +0,0 @@ -sniffFile(__FILE__, '8.0'); - $this->assertWarning($file, $line, 'Explicitly passing "false" as the value for $exclude_disabled to get_defined_functions() is deprecated since PHP 8.0.'); - } - - /** - * Data provider. - * - * @see testRemovedGetDefinedFunctionsExcludeDisabledFalse() - * - * @return array - */ - public function dataRemovedGetDefinedFunctionsExcludeDisabledFalse() - { - return [ - [11], - ]; - } - - - /** - * Verify the sniff does not throw false positives for valid code. - * - * @return void - */ - public function testNoFalsePositives() - { - $file = $this->sniffFile(__FILE__, '8.0'); - - // No errors expected on the first 9 lines. - for ($line = 1; $line <= 9; $line++) { - $this->assertNoViolation($file, $line); - } - } - - - /** - * Verify no notices are thrown at all. - * - * @return void - */ - public function testNoViolationsInFileOnValidVersion() - { - $file = $this->sniffFile(__FILE__, '7.4'); - $this->assertNoViolation($file); - } -} diff --git a/PHPCompatibility/Tests/ParameterValues/RemovedSplAutoloadRegisterThrowFalseUnitTest.inc b/PHPCompatibility/Tests/ParameterValues/RemovedSplAutoloadRegisterThrowFalseUnitTest.inc deleted file mode 100644 index 7703e396..00000000 --- a/PHPCompatibility/Tests/ParameterValues/RemovedSplAutoloadRegisterThrowFalseUnitTest.inc +++ /dev/null @@ -1,15 +0,0 @@ -sniffFile(__FILE__, '8.0'); - $this->assertWarning($file, $line, 'Explicitly passing "false" as the value for $throw to spl_autoload_register() is deprecated since PHP 8.0.'); - } - - /** - * Data provider. - * - * @see testRemovedSplAutoloadRegisterThrowFalse() - * - * @return array - */ - public function dataRemovedSplAutoloadRegisterThrowFalse() - { - return [ - [14], - [15], - ]; - } - - - /** - * Verify the sniff does not throw false positives for valid code. - * - * @return void - */ - public function testNoFalsePositives() - { - $file = $this->sniffFile(__FILE__, '8.0'); - - // No errors expected on the first 12 lines. - for ($line = 1; $line <= 12; $line++) { - $this->assertNoViolation($file, $line); - } - } - - - /** - * Verify no notices are thrown at all. - * - * @return void - */ - public function testNoViolationsInFileOnValidVersion() - { - $file = $this->sniffFile(__FILE__, '7.4'); - $this->assertNoViolation($file); - } -} diff --git a/PHPCompatibility/Tests/TextStrings/RemovedDollarBraceStringEmbedsUnitTest.1.inc b/PHPCompatibility/Tests/TextStrings/RemovedDollarBraceStringEmbedsUnitTest.1.inc deleted file mode 100644 index 4ec71d18..00000000 --- a/PHPCompatibility/Tests/TextStrings/RemovedDollarBraceStringEmbedsUnitTest.1.inc +++ /dev/null @@ -1,90 +0,0 @@ -bar"; -$text = "some text $var some text"; - -$heredoc = <<bar}"; -echo "{$foo->bar()}"; -echo "{$foo['bar']->baz()()}"; -echo "{${$bar}}"; -echo "{$foo()}"; -echo "{${$object->getMethod()}}" -$text = "some text {$var} some text"; - -$heredoc = <<<"EOD" -some text {$var} some text -EOD; - -/* - * Not our target. - */ - -// Ordinary variable variables outside strings. -$foo = ${'bar'}; - -// Heredoc without embeds. -echo <<bar}"; -echo "${$object->getMethod()}" -$text = "some text ${(foo)} some text"; -echo "${substr('laruence', 0, 2)}"; - -echo "${foo["${bar}"]}"; -echo "${foo["${bar['baz']}"]}"; -echo "${foo->{$baz}}"; -echo "${foo->{${'a'}}}"; -echo "${foo->{"${'a'}"}}"; - -// Verify correct handling of stack pointers in multi-token code. -$text = "Line without embed -some text ${foo["${bar}"]} some text -some text ${foo["${bar['baz']}"]} some text -some text ${foo->{${'a'}}} some text -"; - -$heredoc = <<<"EOD" -some text ${(foo)} some text -EOD; diff --git a/PHPCompatibility/Tests/TextStrings/RemovedDollarBraceStringEmbedsUnitTest.2.inc b/PHPCompatibility/Tests/TextStrings/RemovedDollarBraceStringEmbedsUnitTest.2.inc deleted file mode 100644 index f637fbf1..00000000 --- a/PHPCompatibility/Tests/TextStrings/RemovedDollarBraceStringEmbedsUnitTest.2.inc +++ /dev/null @@ -1,42 +0,0 @@ -getMethod()} some text - some text ${foo["${bar['baz']}"]} some text - some text ${foo->{${'a'}}} some text - EOD; diff --git a/PHPCompatibility/Tests/TextStrings/RemovedDollarBraceStringEmbedsUnitTest.php b/PHPCompatibility/Tests/TextStrings/RemovedDollarBraceStringEmbedsUnitTest.php deleted file mode 100644 index 25d0c939..00000000 --- a/PHPCompatibility/Tests/TextStrings/RemovedDollarBraceStringEmbedsUnitTest.php +++ /dev/null @@ -1,256 +0,0 @@ -sniffFile(__DIR__ . '/' . self::TEST_FILE, '8.2'); - $this->assertWarning($file, $line, 'Using ${var} in strings is deprecated since PHP 8.2, use {$var} instead. Found: ' . $found); - } - - /** - * Data provider. - * - * @see testRemovedDollarBraceStringEmbedsType3() - * - * @return array - */ - public function dataRemovedDollarBraceStringEmbedsType3() - { - return [ - [57, '${foo}'], - [58, '${foo[\'bar\']}'], - [59, '${foo}'], - [59, '${text}'], - [62, '${foo}'], - [65, '${foo}'], - ]; - } - - - /** - * Test that variable embeds of "type 4" - Variable variables (“${expr}”, equivalent to - * (string) ${expr}) - are correctly detected. - * - * @dataProvider dataRemovedDollarBraceStringEmbedsType4 - * - * @param int $line The line number. - * @param string $found The embedded expression found. - * - * @return void - */ - public function testRemovedDollarBraceStringEmbedsType4($line, $found) - { - $file = $this->sniffFile(__DIR__ . '/' . self::TEST_FILE, '8.2'); - $this->assertWarning($file, $line, "Using {$found} (variable variables) in strings is deprecated since PHP 8.2, use {\${expr}} instead."); - } - - /** - * Data provider. - * - * @see testRemovedDollarBraceStringEmbedsType4() - * - * @return array - */ - public function dataRemovedDollarBraceStringEmbedsType4() - { - return [ - [68, '${$bar}'], - [69, '${(foo)}'], - [70, '${foo->bar}'], - [71, '${$object->getMethod()}'], - [72, '${(foo)}'], - [73, '${substr(\'laruence\', 0, 2)}'], - [75, '${foo["${bar}"]}'], - [76, '${foo["${bar[\'baz\']}"]}'], - [77, '${foo->{$baz}}'], - [78, '${foo->{${\'a\'}}}'], - [79, '${foo->{"${\'a\'}"}}'], - [83, '${foo["${bar}"]}'], - [84, '${foo["${bar[\'baz\']}"]}'], - [85, '${foo->{${\'a\'}}}'], - [89, '${(foo)}'], - ]; - } - - - /** - * Test that variable embeds of "type 3" - Braces after the dollar sign (“${foo}”) - - * are correctly detected in PHP 7.3+ indented heredocs. - * - * @dataProvider dataRemovedDollarBraceStringEmbedsType3InIndentedHeredoc - * - * @param int $line The line number. - * @param string $found The embedded variable found. - * - * @return void - */ - public function testRemovedDollarBraceStringEmbedsType3InIndentedHeredoc($line, $found) - { - if (\PHP_VERSION_ID < 70300) { - $this->markTestSkipped('Test code involving PHP 7.3 heredocs will not tokenize correctly on PHP < 7.3'); - } - - $file = $this->sniffFile(__DIR__ . '/' . self::TEST_FILE_PHP73HEREDOCS, '8.2'); - $this->assertWarning($file, $line, 'Using ${var} in strings is deprecated since PHP 8.2, use {$var} instead. Found: ' . $found); - } - - /** - * Data provider. - * - * @see testRemovedDollarBraceStringEmbedsType3InIndentedHeredoc() - * - * @return array - */ - public function dataRemovedDollarBraceStringEmbedsType3InIndentedHeredoc() - { - return [ - [33, '${foo[\'bar\']}'], - ]; - } - - - /** - * Test that variable embeds of "type 4" - Variable variables (“${expr}”, equivalent to - * (string) ${expr}) - are correctly detected in PHP 7.3+ indented heredocs. - * - * @dataProvider dataRemovedDollarBraceStringEmbedsType4InIndentedHeredoc - * - * @param int $line The line number. - * @param string $found The embedded expression found. - * - * @return void - */ - public function testRemovedDollarBraceStringEmbedsType4InIndentedHeredoc($line, $found) - { - if (\PHP_VERSION_ID < 70300) { - $this->markTestSkipped('Test code involving PHP 7.3 heredocs will not tokenize correctly on PHP < 7.3'); - } - - $file = $this->sniffFile(__DIR__ . '/' . self::TEST_FILE_PHP73HEREDOCS, '8.2'); - $this->assertWarning($file, $line, "Using {$found} (variable variables) in strings is deprecated since PHP 8.2, use {\${expr}} instead."); - } - - /** - * Data provider. - * - * @see testRemovedDollarBraceStringEmbedsType4InIndentedHeredoc() - * - * @return array - */ - public function dataRemovedDollarBraceStringEmbedsType4InIndentedHeredoc() - { - return [ - [39, '${$object->getMethod()}'], - [40, '${foo["${bar[\'baz\']}"]}'], - [41, '${foo->{${\'a\'}}}'], - ]; - } - - - /** - * Verify the sniff does not throw false positives for valid code. - * - * @dataProvider dataTestFiles - * - * @param string $testFile File name for the test case file to use. - * @param int $lines Number of lines at the top of the file for which we don't expect errors. - * - * @return void - */ - public function testNoFalsePositives($testFile, $lines) - { - if ($testFile === self::TEST_FILE_PHP73HEREDOCS && \PHP_VERSION_ID < 70300) { - $this->markTestSkipped('Test code involving PHP 7.3 heredocs will not tokenize correctly on PHP < 7.3'); - } - - $file = $this->sniffFile(__DIR__ . '/' . $testFile, '8.2'); - - // No errors expected on the first # lines. - for ($line = 1; $line <= $lines; $line++) { - $this->assertNoViolation($file, $line); - } - } - - - /** - * Verify no notices are thrown at all. - * - * @dataProvider dataTestFiles - * - * @param string $testFile File name for the test case file to use. - * - * @return void - */ - public function testNoViolationsInFileOnValidVersion($testFile) - { - if ($testFile === self::TEST_FILE_PHP73HEREDOCS && \PHP_VERSION_ID < 70300) { - $this->markTestSkipped('Test code involving PHP 7.3 heredocs will not tokenize correctly on PHP < 7.3'); - } - - $file = $this->sniffFile(__DIR__ . '/' . $testFile, '8.1'); - $this->assertNoViolation($file); - } - - - /** - * Data provider. - * - * @return array - */ - public function dataTestFiles() - { - return [ - [self::TEST_FILE, 51], - [self::TEST_FILE_PHP73HEREDOCS, 26], - ]; - } -} diff --git a/composer.json b/composer.json index c3fed220..e4c0c17b 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "squizlabs/php_codesniffer": "^3.6.1", "rector/rector": "^0.15.10", "symfony/polyfill": "^1.16", - "phpcsstandards/phpcsutils": "~1.0.5" + "phpcsstandards/phpcsutils": "^1.0.5" }, "require-dev": { "phpunit/phpunit": "^9.5.8", @@ -33,8 +33,7 @@ ], "psr-4": { "Magento2\\": "Magento2/", - "Magento2Framework\\": "Magento2Framework/", - "PHPCompatibility\\": "PHPCompatibility/" + "Magento2Framework\\": "Magento2Framework/" } }, "scripts": { diff --git a/composer.lock b/composer.lock index 56d67192..eb5742d8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9ddd67b442b71fc7f10119eac7e40140", + "content-hash": "005e2882d6bfb6ebf35f0acfa890efac", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", diff --git a/phpunit-bootstrap.php b/phpunit-bootstrap.php index 487e0170..585cf634 100644 --- a/phpunit-bootstrap.php +++ b/phpunit-bootstrap.php @@ -1,15 +1,7 @@ =') - && class_exists('PHPUnit_Framework_TestCase') === false -) { - class_alias('PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase'); -} - -unset($ds, $phpcsDir, $vendorDir); +require_once __DIR__ . '/vendor/squizlabs/php_codesniffer/autoload.php'; +require_once __DIR__ . '/vendor/phpcompatibility/php-compatibility/PHPCSAliases.php'; From 8d37ab7b8eb9c204abf2adcb2e637065595021c5 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Sun, 28 May 2023 18:32:02 +0100 Subject: [PATCH 22/42] Update supported PHP versions --- .github/workflows/php.yml | 6 +----- Magento2/ruleset.xml | 4 ++-- composer.json | 2 +- composer.lock | 4 ++-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index ac9fc0a0..52b6a97f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -13,15 +13,11 @@ jobs: fail-fast: false matrix: php-version: - - "7.4" - - "8.0" - "8.1" + - "8.2" dependencies: - "lowest" - "highest" - exclude: - - php-version: "8.1" - dependencies: "lowest" name: Tests with PHP ${{ matrix.php-version }} and ${{ matrix.dependencies }} dependencies steps: diff --git a/Magento2/ruleset.xml b/Magento2/ruleset.xml index 6234fb1b..4ff483e4 100644 --- a/Magento2/ruleset.xml +++ b/Magento2/ruleset.xml @@ -350,7 +350,7 @@ 8 warning - + 7 @@ -762,7 +762,7 @@ - + diff --git a/composer.json b/composer.json index c3fed220..bca16d28 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "type": "phpcodesniffer-standard", "version": "31", "require": { - "php": ">=7.4", + "php": "~8.1.0 || ~8.2.0", "webonyx/graphql-php": "^15.0", "ext-simplexml": "*", "ext-dom": "*", diff --git a/composer.lock b/composer.lock index 56d67192..8c9becb7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9ddd67b442b71fc7f10119eac7e40140", + "content-hash": "d941f20e7ac60684443f46eca9c86f5d", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -2377,7 +2377,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.4", + "php": "~8.1.0 || ~8.2.0", "ext-simplexml": "*", "ext-dom": "*" }, From d95dff812afd308a03e635fad60d1691fc73f7ea Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 29 May 2023 11:37:28 +0100 Subject: [PATCH 23/42] Remove now-unused file --- Magento2/Internal/FileProxy.php | 465 -------------------------------- 1 file changed, 465 deletions(-) delete mode 100644 Magento2/Internal/FileProxy.php diff --git a/Magento2/Internal/FileProxy.php b/Magento2/Internal/FileProxy.php deleted file mode 100644 index a95043d7..00000000 --- a/Magento2/Internal/FileProxy.php +++ /dev/null @@ -1,465 +0,0 @@ - callable. For example: ['addError' => fn() => {}] - */ - public function __construct(\PHP_CodeSniffer\Files\File $file, array $proxies = []) - { - $this->file = $file; - $this->proxies = $proxies; - // parent constructor is not called intentionally - } - - /** - * @inheritdoc - */ - public function setContent($content) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($content); - } - return $this->file->setContent($content); - } - - /** - * @inheritdoc - */ - public function reloadContent() - { - if (isset($this->proxies[__FUNCTION__])) { - ($this->proxies[__FUNCTION__])(); - } - $this->file->reloadContent(); - } - - /** - * @inheritdoc - */ - public function disableCaching() - { - if (isset($this->proxies[__FUNCTION__])) { - ($this->proxies[__FUNCTION__])(); - } - $this->file->disableCaching(); - } - - /** - * @inheritdoc - */ - public function process() - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])(); - } - return $this->file->process(); - } - - /** - * @inheritdoc - */ - public function parse() - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])(); - } - return $this->file->parse(); - } - - /** - * @inheritdoc - */ - public function getTokens() - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])(); - } - return $this->file->getTokens(); - } - - /** - * @inheritdoc - */ - public function cleanUp() - { - if (isset($this->proxies[__FUNCTION__])) { - ($this->proxies[__FUNCTION__])(); - } - $this->file->cleanUp(); - } - - /** - * @inheritdoc - */ - public function addError($error, $stackPtr, $code, $data = [], $severity = 0, $fixable = false) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($error, $stackPtr, $code, $data, $severity, $fixable); - } - return $this->file->addError($error, $stackPtr, $code, $data, $severity, $fixable); - } - - /** - * @inheritdoc - */ - public function addWarning($warning, $stackPtr, $code, $data = [], $severity = 0, $fixable = false) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($warning, $stackPtr, $code, $data, $severity, $fixable); - } - return $this->file->addFixableWarning($warning, $stackPtr, $code, $data, $severity); - } - - /** - * @inheritdoc - */ - public function addErrorOnLine($error, $line, $code, $data = [], $severity = 0) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($error, $line, $code, $data, $severity); - } - return $this->file->addErrorOnLine($error, $line, $code, $data, $severity); - } - - /** - * @inheritdoc - */ - public function addWarningOnLine($warning, $line, $code, $data = [], $severity = 0) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($warning, $line, $code, $data, $severity); - } - return $this->file->addWarningOnLine($warning, $line, $code, $data, $severity); - } - - /** - * @inheritdoc - */ - public function addFixableError($error, $stackPtr, $code, $data = [], $severity = 0) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($error, $stackPtr, $code, $data, $severity); - } - return $this->file->addFixableError($error, $stackPtr, $code, $data, $severity); - } - - /** - * @inheritdoc - */ - public function addFixableWarning($warning, $stackPtr, $code, $data = [], $severity = 0) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($warning, $stackPtr, $code, $data, $severity); - } - return $this->file->addFixableWarning($warning, $stackPtr, $code, $data, $severity); - } - - /** - * @inheritdoc - */ - public function recordMetric($stackPtr, $metric, $value) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($stackPtr, $metric, $value); - } - return $this->file->recordMetric($stackPtr, $metric, $value); - } - - /** - * @inheritdoc - */ - public function getErrorCount() - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])(); - } - return $this->file->getErrorCount(); - } - - /** - * @inheritdoc - */ - public function getWarningCount() - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])(); - } - return $this->file->getWarningCount(); - } - - /** - * @inheritdoc - */ - public function getFixableCount() - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])(); - } - return $this->file->getFixableCount(); - } - - /** - * @inheritdoc - */ - public function getFixedCount() - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])(); - } - return $this->file->getFixedCount(); - } - - /** - * @inheritdoc - */ - public function getIgnoredLines() - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])(); - } - return $this->file->getIgnoredLines(); - } - - /** - * @inheritdoc - */ - public function getErrors() - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])(); - } - return $this->file->getErrors(); - } - - /** - * @inheritdoc - */ - public function getWarnings() - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])(); - } - return $this->file->getWarnings(); - } - - /** - * @inheritdoc - */ - public function getMetrics() - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])(); - } - return $this->file->getMetrics(); - } - - /** - * @inheritdoc - */ - public function getFilename() - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])(); - } - return $this->file->getFilename(); - } - - /** - * @inheritdoc - */ - public function getDeclarationName($stackPtr) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($stackPtr); - } - return $this->file->getDeclarationName($stackPtr); - } - - /** - * @inheritdoc - */ - public function getMethodParameters($stackPtr) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($stackPtr); - } - return $this->file->getMethodParameters($stackPtr); - } - - /** - * @inheritdoc - */ - public function getMethodProperties($stackPtr) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($stackPtr); - } - return $this->file->getMethodProperties($stackPtr); - } - - /** - * @inheritdoc - */ - public function getMemberProperties($stackPtr) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($stackPtr); - } - return $this->file->getMemberProperties($stackPtr); - } - - /** - * @inheritdoc - */ - public function getClassProperties($stackPtr) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($stackPtr); - } - return $this->file->getClassProperties($stackPtr); - } - - /** - * @inheritdoc - */ - public function isReference($stackPtr) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($stackPtr); - } - return $this->file->isReference($stackPtr); - } - - /** - * @inheritdoc - */ - public function getTokensAsString($start, $length, $origContent = false) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($start, $length, $origContent); - } - return $this->file->getTokensAsString($start, $length, $origContent); - } - - /** - * @inheritdoc - */ - public function findPrevious($types, $start, $end = null, $exclude = false, $value = null, $local = false) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($types, $start, $end, $exclude, $value, $local); - } - return $this->file->findPrevious($types, $start, $end, $exclude, $value, $local); - } - - /** - * @inheritdoc - */ - public function findNext($types, $start, $end = null, $exclude = false, $value = null, $local = false) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($types, $start, $end, $exclude, $value, $local); - } - return $this->file->findNext($types, $start, $end, $exclude, $value, $local); - } - - /** - * @inheritdoc - */ - public function findStartOfStatement($start, $ignore = null) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($start, $ignore); - } - return $this->file->findStartOfStatement($start, $ignore); - } - - /** - * @inheritdoc - */ - public function findEndOfStatement($start, $ignore = null) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($start, $ignore); - } - return $this->file->findEndOfStatement($start, $ignore); - } - - /** - * @inheritdoc - */ - public function findFirstOnLine($types, $start, $exclude = false, $value = null) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($types, $start, $exclude, $value); - } - return $this->file->findFirstOnLine($types, $start, $exclude, $value); - } - - /** - * @inheritdoc - */ - public function hasCondition($stackPtr, $types) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($stackPtr, $types); - } - return $this->file->hasCondition($stackPtr, $types); - } - - /** - * @inheritdoc - */ - public function getCondition($stackPtr, $type, $first = true) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($stackPtr, $type, $first); - } - return $this->file->getCondition($stackPtr, $type, $first); - } - - /** - * @inheritdoc - */ - public function findExtendedClassName($stackPtr) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($stackPtr); - } - return $this->file->findExtendedClassName($stackPtr); - } - - /** - * @inheritdoc - */ - /** - * @inheritdoc - */ - public function findImplementedInterfaceNames($stackPtr) - { - if (isset($this->proxies[__FUNCTION__])) { - return ($this->proxies[__FUNCTION__])($stackPtr); - } - return $this->file->findImplementedInterfaceNames($stackPtr); - } -} From 053efe7414788b71ed3e8310dd020f757bfba297 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 29 May 2023 12:17:52 +0100 Subject: [PATCH 24/42] Increase minimum version of PHPUnit to fix tests --- composer.json | 2 +- composer.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index bca16d28..6b493d7a 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "phpcsstandards/phpcsutils": "~1.0.5" }, "require-dev": { - "phpunit/phpunit": "^9.5.8", + "phpunit/phpunit": "^9.5.10", "yoast/phpunit-polyfills": "^1.0" }, "autoload-dev": { diff --git a/composer.lock b/composer.lock index 8c9becb7..b778b3da 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d941f20e7ac60684443f46eca9c86f5d", + "content-hash": "93c2fcc45c74921ed7ed7b99da7505fa", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", From 28cd6683ab15b9684ffe22d1303a4041566056ae Mon Sep 17 00:00:00 2001 From: soumah Date: Tue, 6 Jun 2023 14:08:27 -0500 Subject: [PATCH 25/42] ACP2E-2032: Fix failed builds --- phpunit-bootstrap.php | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/phpunit-bootstrap.php b/phpunit-bootstrap.php index 585cf634..94f424dd 100644 --- a/phpunit-bootstrap.php +++ b/phpunit-bootstrap.php @@ -1,21 +1,14 @@ Date: Tue, 6 Jun 2023 14:38:16 -0500 Subject: [PATCH 26/42] ACP2E-2032: Fix ruleset --- Magento2/ruleset.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Magento2/ruleset.xml b/Magento2/ruleset.xml index 770b3643..ceca9e7e 100644 --- a/Magento2/ruleset.xml +++ b/Magento2/ruleset.xml @@ -168,6 +168,10 @@ 10 error + + 10 + error + 9 @@ -763,7 +767,5 @@ - - From 889b4d21076d2ddef54d948c63688770a6449310 Mon Sep 17 00:00:00 2001 From: sandip Date: Mon, 12 Jun 2023 15:42:27 +0530 Subject: [PATCH 27/42] Add test case for readonly property --- .../ClassPropertyPHPDocFormattingUnitTest.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc b/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc index cde71269..aca8a73b 100644 --- a/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc +++ b/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc @@ -200,4 +200,14 @@ class correctlyFormattedClassMemberDocBlock * @deprecated This property will be removed in version 1.0.0 without replacement */ protected string $deprecatedWithKeyword; + + /** + * @var string + */ + protected readonly string $readOnlyString; + + /** + * @var int + */ + protected readonly int $readOnlyInteger; } From 7b6bd743937183d00390a9fdd9d3fa7af389ac30 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 6 Jul 2023 14:48:29 +0100 Subject: [PATCH 28/42] Add sniff for deprecated use of $block->escape... --- .../Legacy/EscapeMethodsOnBlockClassSniff.php | 100 ++++++++++++++++++ .../EscapeMethodsOnBlockClassUnitTest.inc | 87 +++++++++++++++ ...scapeMethodsOnBlockClassUnitTest.inc.fixed | 87 +++++++++++++++ .../EscapeMethodsOnBlockClassUnitTest.php | 45 ++++++++ 4 files changed, 319 insertions(+) create mode 100644 Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php create mode 100644 Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc create mode 100644 Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc.fixed create mode 100644 Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.php diff --git a/Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php b/Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php new file mode 100644 index 00000000..f44e3d0c --- /dev/null +++ b/Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php @@ -0,0 +1,100 @@ + true, + 'escapeHtml' => true, + 'escapeHtmlAttr' => true, + 'escapeJs' => true, + 'escapeJsQuote' => true, + 'escapeQuote' => true, + 'escapeUrl' => true, + 'escapeXssInUrl' => true, + ]; + + public function register() + { + return [ + T_OBJECT_OPERATOR, + ]; + } + + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if ($stackPtr <= 1 || !isset($tokens[$stackPtr + 2])) { + return; + } + + $objectPtr = $stackPtr - 1; + if ($tokens[$objectPtr]['code'] !== T_VARIABLE) { + $objectPtr = $phpcsFile->findPrevious(Tokens::$emptyTokens, $objectPtr, null, true); + + if (!$objectPtr) { + return; + } + } + + if ($tokens[$objectPtr]['code'] !== T_VARIABLE + || $tokens[$objectPtr]['content'] !== '$block' + ) { + return; + } + + $methodPtr = $stackPtr + 1; + if ($tokens[$methodPtr]['code'] !== T_STRING) { + $methodPtr = $phpcsFile->findNext(Tokens::$emptyTokens, $methodPtr, null, true); + + if (!$methodPtr) { + return; + } + } + + if ($tokens[$methodPtr]['code'] !== T_STRING + || !isset(self::ESCAPER_METHODS[$tokens[$methodPtr]['content']]) + ) { + return; + } + + $openParenPtr = $methodPtr + 1; + if ($tokens[$openParenPtr]['code'] !== T_OPEN_PARENTHESIS) { + $openParenPtr = $phpcsFile->findNext(Tokens::$emptyTokens, $openParenPtr, null, true); + + if (!$openParenPtr) { + return; + } + } + + if ($tokens[$openParenPtr]['code'] !== T_OPEN_PARENTHESIS) { + return; + } + + $fix = $phpcsFile->addFixableWarning( + 'Using %s on $block is deprecated. Please use equivalent method on $escaper', + $methodPtr, + 'Found', + [ + $tokens[$methodPtr]['content'], // method name + ] + ); + + if ($fix) { + $phpcsFile->fixer->replaceToken($objectPtr, '$escaper'); + } + } +} diff --git a/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc b/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc new file mode 100644 index 00000000..260f0c93 --- /dev/null +++ b/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc @@ -0,0 +1,87 @@ + + +
+

This unescaped output is fine here; other sniffs will complain about it though.

+ + getSomeString(); ?> + getSomeString(); ?> + getSomeString(); ?> + getSomeString(); ?> +
+ +
+

These should be using equivalent methods on the `$escaper` class, not the `$block` class.

+ + Note that I couldn't find any use of this method in any templates within Magento. + escapeCss($block->getSomeString()); ?> + + escapeHtml(__($block->getSomeString())) ?> + escapeHtml(__($block->getSomeString())); ?> + escapeHtml(__($block->getSomeString()), ['strong', 'em', 'span']) ?> + +
+
+
+ + + + The only example of this method being used was in a block class, rather than a template. + getItems() as $item) { + $item['sku'] = $block->escapeJsQuote($item['sku']); + } + ?> + + The only example of this method being used was in a block class, rather than a template. + escapeQuote(__($block->getData('welcome'))); ?> + + link text + + Note that I couldn't find any use of this method in any templates within Magento. + escapeXssInUrl($block->getSomeString()); ?> +
+ +
+

These are edge cases for formatting differences

+ + escapeHtml(''); + $block ->escapeHtml(''); + $block-> escapeHtml(''); + $block + ->escapeHtml(''); + $block + + ->escapeHtml(''); + $block-> + escapeHtml(''); + $block-> // comment + escapeHtml(''); + $block /* comment */ + ->escapeHtml(''); + + $block /* comment */ -> /* comment */ escapeHtml(''); + ?> +
+ +
+

These close-matches shouldn't be flagged by this sniff.

+ + escapeHTML(__($block->getSomeString())) ?> + escapeHtmlString(__($block->getSomeString())) ?> + escapeHtmlAttribute($block->getSomeString()) ?> + escapeCSS($block->getSomeString()); ?> + escapeJS($block->getData('html_id')) ?> + escapeJavaScript($block->getData('html_id')) ?> + escapeQuotes(__($block->getData('welcome'))); ?> + escapeURL($block->getUrl('adminhtml/notification/index')) ?> +
diff --git a/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc.fixed b/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc.fixed new file mode 100644 index 00000000..80c4f22c --- /dev/null +++ b/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc.fixed @@ -0,0 +1,87 @@ + + +
+

This unescaped output is fine here; other sniffs will complain about it though.

+ + getSomeString(); ?> + getSomeString(); ?> + getSomeString(); ?> + getSomeString(); ?> +
+ +
+

These should be using equivalent methods on the `$escaper` class, not the `$block` class.

+ + Note that I couldn't find any use of this method in any templates within Magento. + escapeCss($block->getSomeString()); ?> + + escapeHtml(__($block->getSomeString())) ?> + escapeHtml(__($block->getSomeString())); ?> + escapeHtml(__($block->getSomeString()), ['strong', 'em', 'span']) ?> + +
+
+
+ + + + The only example of this method being used was in a block class, rather than a template. + getItems() as $item) { + $item['sku'] = $escaper->escapeJsQuote($item['sku']); + } + ?> + + The only example of this method being used was in a block class, rather than a template. + escapeQuote(__($block->getData('welcome'))); ?> + + link text + + Note that I couldn't find any use of this method in any templates within Magento. + escapeXssInUrl($block->getSomeString()); ?> +
+ +
+

These are edge cases for formatting differences

+ + escapeHtml(''); + $escaper ->escapeHtml(''); + $escaper-> escapeHtml(''); + $escaper + ->escapeHtml(''); + $escaper + + ->escapeHtml(''); + $escaper-> + escapeHtml(''); + $escaper-> // comment + escapeHtml(''); + $escaper /* comment */ + ->escapeHtml(''); + + $escaper /* comment */ -> /* comment */ escapeHtml(''); + ?> +
+ +
+

These close-matches shouldn't be flagged by this sniff.

+ + escapeHTML(__($block->getSomeString())) ?> + escapeHtmlString(__($block->getSomeString())) ?> + escapeHtmlAttribute($block->getSomeString()) ?> + escapeCSS($block->getSomeString()); ?> + escapeJS($block->getData('html_id')) ?> + escapeJavaScript($block->getData('html_id')) ?> + escapeQuotes(__($block->getData('welcome'))); ?> + escapeURL($block->getUrl('adminhtml/notification/index')) ?> +
diff --git a/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.php b/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.php new file mode 100644 index 00000000..feead3d1 --- /dev/null +++ b/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.php @@ -0,0 +1,45 @@ + 1, + 21 => 1, + 22 => 1, + 23 => 1, + 25 => 1, + 26 => 1, + 27 => 1, + 31 => 1, + 40 => 1, + 45 => 1, + 47 => 1, + 50 => 1, + 57 => 1, + 58 => 1, + 59 => 1, + 61 => 1, + 64 => 1, + 66 => 1, + 68 => 1, + 70 => 1, + 72 => 1, + ]; + } +} From b8acb6c61a735b9770470ea44cefbebf70139f69 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 6 Jul 2023 15:25:49 +0100 Subject: [PATCH 29/42] Add docblock to appease coding standard Note that these are useless, as it's the default behaviour to inherit from the parent docblock. --- Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php b/Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php index f44e3d0c..4d6d8288 100644 --- a/Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php +++ b/Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php @@ -26,6 +26,9 @@ class EscapeMethodsOnBlockClassSniff implements Sniff 'escapeXssInUrl' => true, ]; + /** + * @inheritDoc + */ public function register() { return [ @@ -33,6 +36,9 @@ public function register() ]; } + /** + * @inheritDoc + */ public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); From 0c945598626e0a9c4a9379f65e2547827f7a5544 Mon Sep 17 00:00:00 2001 From: Atul-glo35265 Date: Tue, 25 Jul 2023 13:32:36 +0530 Subject: [PATCH 30/42] AC-9184::Static Tests Failure on using Adobe copyright content - Added condition to use copyright in new format --- Magento2Framework/Sniffs/Header/CopyrightSniff.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Magento2Framework/Sniffs/Header/CopyrightSniff.php b/Magento2Framework/Sniffs/Header/CopyrightSniff.php index 81442207..e23aaba4 100644 --- a/Magento2Framework/Sniffs/Header/CopyrightSniff.php +++ b/Magento2Framework/Sniffs/Header/CopyrightSniff.php @@ -16,6 +16,7 @@ class CopyrightSniff implements Sniff private const COPYRIGHT_MAGENTO_TEXT = 'Copyright © Magento, Inc. All rights reserved.'; private const COPYRIGHT_ADOBE = '/Copyright \d+ Adobe/'; + private const COPYRIGHT_ADOBE_TEXT = 'ADOBE CONFIDENTIAL'; /** * @inheritdoc @@ -48,7 +49,9 @@ public function process(File $phpcsFile, $stackPtr) $content = $phpcsFile->getTokens()[$positionComment]['content']; $adobeCopyrightFound = preg_match(self::COPYRIGHT_ADOBE, $content); - if (strpos($content, self::COPYRIGHT_MAGENTO_TEXT) !== false || $adobeCopyrightFound) { + if (strpos($content, self::COPYRIGHT_MAGENTO_TEXT) !== false || + $adobeCopyrightFound || + strpos($content, self::COPYRIGHT_ADOBE_TEXT) !== false) { return; } From 5497f3f9f4b7c478ce6d1bef2f792ee16de33e4f Mon Sep 17 00:00:00 2001 From: Zach Stein Date: Wed, 26 Jul 2023 14:19:57 -0400 Subject: [PATCH 31/42] Update README.md Fixed a typo in readme.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3cfd6c0a..8ca973e1 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ npm run eslint -- path/to/analyze ``` ### RECTOR PHP -From `magento-condign-standard` project, you can execute rector php as follows: +From `magento-coding-standard` project, you can execute rector php as follows: ```bash vendor/bin/rector process Magento2 Magento2Framework PHP_CodeSniffer --dry-run --autoload-file vendor/squizlabs/php_codesniffer/autoload.php ``` From 1aced4b2a1a380bb052607ab94f62c14dd8e6c5e Mon Sep 17 00:00:00 2001 From: Rimple Saini Date: Thu, 27 Jul 2023 17:14:01 +0530 Subject: [PATCH 32/42] AC-9184::Static Tests Failure on using Adobe copyright content - Update Version --- composer.json | 2 +- composer.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index e4c0c17b..e3c79454 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "AFL-3.0" ], "type": "phpcodesniffer-standard", - "version": "31", + "version": "32", "require": { "php": ">=7.4", "webonyx/graphql-php": "^15.0", diff --git a/composer.lock b/composer.lock index eb5742d8..993e2d97 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "005e2882d6bfb6ebf35f0acfa890efac", + "content-hash": "527277cebca41c223661e203e2f5f5e7", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -2382,5 +2382,5 @@ "ext-dom": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } From 7704854ed6b9c8bb29fa62a946e15ee8abcb434b Mon Sep 17 00:00:00 2001 From: Atul-glo35265 Date: Fri, 28 Jul 2023 11:50:24 +0530 Subject: [PATCH 33/42] AC-9184::Static Tests Failure on using Adobe copyright content - Added condition to use copyright in new format --- .../Sniffs/Header/CopyrightAnotherExtensionsFilesSniff.php | 2 ++ Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Magento2Framework/Sniffs/Header/CopyrightAnotherExtensionsFilesSniff.php b/Magento2Framework/Sniffs/Header/CopyrightAnotherExtensionsFilesSniff.php index 3bafbb1f..3310e667 100644 --- a/Magento2Framework/Sniffs/Header/CopyrightAnotherExtensionsFilesSniff.php +++ b/Magento2Framework/Sniffs/Header/CopyrightAnotherExtensionsFilesSniff.php @@ -16,6 +16,7 @@ class CopyrightAnotherExtensionsFilesSniff implements Sniff private const COPYRIGHT_MAGENTO_TEXT = 'Copyright © Magento, Inc. All rights reserved.'; private const COPYRIGHT_ADOBE = '/Copyright \d+ Adobe/'; + private const COPYRIGHT_ADOBE_TEXT = 'ADOBE CONFIDENTIAL'; /** * Defines the tokenizers that this sniff is using. @@ -48,6 +49,7 @@ public function process(File $phpcsFile, $stackPtr) if (strpos($fileText, self::COPYRIGHT_MAGENTO_TEXT) !== false || preg_match(self::COPYRIGHT_ADOBE, $fileText) + || strpos($fileText, self::COPYRIGHT_ADOBE_TEXT) !== false ) { return; } diff --git a/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php b/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php index 1e488e69..5eae2b5e 100644 --- a/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php +++ b/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php @@ -16,6 +16,7 @@ class CopyrightGraphQLSniff implements Sniff private const COPYRIGHT_MAGENTO_TEXT = 'Copyright © Magento, Inc. All rights reserved.'; private const COPYRIGHT_ADOBE = '/Copyright \d+ Adobe/'; + private const COPYRIGHT_ADOBE_TEXT = 'ADOBE CONFIDENTIAL'; private const FILE_EXTENSION = 'graphqls'; @@ -44,7 +45,9 @@ public function process(File $phpcsFile, $stackPtr) // @phpcs:ignore Magento2.Functions.DiscouragedFunction.Discouraged $content = file_get_contents($phpcsFile->getFilename()); - if (strpos($content, self::COPYRIGHT_MAGENTO_TEXT) !== false || preg_match(self::COPYRIGHT_ADOBE, $content)) { + if (strpos($content, self::COPYRIGHT_MAGENTO_TEXT) !== false + || preg_match(self::COPYRIGHT_ADOBE, $content) + || strpos($content, self::COPYRIGHT_ADOBE_TEXT) !== false) { return; } From 42f012962c566b552c43b12bb8f59e7c5ef798ee Mon Sep 17 00:00:00 2001 From: Atul-glo35265 Date: Mon, 14 Aug 2023 16:47:33 +0530 Subject: [PATCH 34/42] Resolve Conflict --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 993e2d97..4a94589d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "527277cebca41c223661e203e2f5f5e7", + "content-hash": "2cb0816434787b635536aa2fd6ac017f", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -2377,10 +2377,10 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.4", + "php": "~8.1.0 || ~8.2.0", "ext-simplexml": "*", "ext-dom": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" -} + "plugin-api-version": "2.3.0" +} \ No newline at end of file From e52de693a38700c1a577c29af45527e9246bd2fa Mon Sep 17 00:00:00 2001 From: Atul-glo35265 Date: Thu, 24 Aug 2023 15:55:37 +0530 Subject: [PATCH 35/42] AC-9184::Static Tests Failure on using Adobe copyright content - Update Rector Dependency --- composer.json | 2 +- composer.lock | 45 ++++++++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/composer.json b/composer.json index 04d1abc9..2d2c9974 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "ext-dom": "*", "phpcompatibility/php-compatibility": "^9.3", "squizlabs/php_codesniffer": "^3.6.1", - "rector/rector": "^0.15.10", + "rector/rector": "^0.18.0", "symfony/polyfill": "^1.16", "phpcsstandards/phpcsutils": "^1.0.5" }, diff --git a/composer.lock b/composer.lock index 4a94589d..f63a6852 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2cb0816434787b635536aa2fd6ac017f", + "content-hash": "fecbeaf15a13fcb2776f3ac54efa39fb", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -222,16 +222,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.9.14", + "version": "1.10.30", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58" + "reference": "2910afdd3fe33e5afd71c09f3fb0d0845b48c410" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5fcc96289cf737304286a9b505fbed091f02e58", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2910afdd3fe33e5afd71c09f3fb0d0845b48c410", + "reference": "2910afdd3fe33e5afd71c09f3fb0d0845b48c410", "shasum": "" }, "require": { @@ -260,8 +260,11 @@ "static analysis" ], "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.14" + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { @@ -277,30 +280,29 @@ "type": "tidelift" } ], - "time": "2023-01-19T10:47:09+00:00" + "time": "2023-08-22T13:48:25+00:00" }, { "name": "rector/rector", - "version": "0.15.10", + "version": "0.18.0", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "000bfb6f7974449399f39e1a210458395b75c887" + "reference": "758ada29b5c80d933f906735d3026520390a2a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/000bfb6f7974449399f39e1a210458395b75c887", - "reference": "000bfb6f7974449399f39e1a210458395b75c887", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/758ada29b5c80d933f906735d3026520390a2a1d", + "reference": "758ada29b5c80d933f906735d3026520390a2a1d", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.9.7" + "phpstan/phpstan": "^1.10.26" }, "conflict": { "rector/rector-doctrine": "*", "rector/rector-downgrade-php": "*", - "rector/rector-php-parser": "*", "rector/rector-phpunit": "*", "rector/rector-symfony": "*" }, @@ -308,11 +310,6 @@ "bin/rector" ], "type": "library", - "extra": { - "branch-alias": { - "dev-main": "0.14-dev" - } - }, "autoload": { "files": [ "bootstrap.php" @@ -323,9 +320,15 @@ "MIT" ], "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.15.10" + "source": "https://github.com/rectorphp/rector/tree/0.18.0" }, "funding": [ { @@ -333,7 +336,7 @@ "type": "github" } ], - "time": "2023-01-21T14:30:16+00:00" + "time": "2023-08-17T12:53:22+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -2383,4 +2386,4 @@ }, "platform-dev": [], "plugin-api-version": "2.3.0" -} \ No newline at end of file +} From 5e4ef1363044093aaf7d54ce7cd98fac914b01aa Mon Sep 17 00:00:00 2001 From: Atul-glo35265 Date: Thu, 24 Aug 2023 16:32:55 +0530 Subject: [PATCH 36/42] AC-9184::Static Tests Failure on using Adobe copyright content - Update Rector Dependency --- composer.json | 2 +- composer.lock | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 2d2c9974..54c62c61 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "ext-dom": "*", "phpcompatibility/php-compatibility": "^9.3", "squizlabs/php_codesniffer": "^3.6.1", - "rector/rector": "^0.18.0", + "rector/rector": "^0.16.0", "symfony/polyfill": "^1.16", "phpcsstandards/phpcsutils": "^1.0.5" }, diff --git a/composer.lock b/composer.lock index f63a6852..833823d8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fecbeaf15a13fcb2776f3ac54efa39fb", + "content-hash": "85706157c667b84ac6386062a90f04cb", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -284,21 +284,21 @@ }, { "name": "rector/rector", - "version": "0.18.0", + "version": "0.16.0", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "758ada29b5c80d933f906735d3026520390a2a1d" + "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/758ada29b5c80d933f906735d3026520390a2a1d", - "reference": "758ada29b5c80d933f906735d3026520390a2a1d", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/2125ff71ea05b079562a8f59ca48a97eb78dc07f", + "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.26" + "phpstan/phpstan": "^1.10.14" }, "conflict": { "rector/rector-doctrine": "*", @@ -310,6 +310,11 @@ "bin/rector" ], "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.15-dev" + } + }, "autoload": { "files": [ "bootstrap.php" @@ -328,7 +333,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.18.0" + "source": "https://github.com/rectorphp/rector/tree/0.16.0" }, "funding": [ { @@ -336,7 +341,7 @@ "type": "github" } ], - "time": "2023-08-17T12:53:22+00:00" + "time": "2023-05-05T12:12:17+00:00" }, { "name": "squizlabs/php_codesniffer", From a7257ac1e063dcab3cb27049046927a28c7aed5f Mon Sep 17 00:00:00 2001 From: Atul-glo35265 Date: Thu, 24 Aug 2023 16:59:28 +0530 Subject: [PATCH 37/42] AC-9184::Static Tests Failure on using Adobe copyright content - Update Rector Dependency AC-9184::Static Tests Failure on using Adobe copyright content - Update Rector Dependency AC-9184::Static Tests Failure on using Adobe copyright content - Update Rector Dependency to latest version --- composer.json | 2 +- composer.lock | 21 ++++++++------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 54c62c61..afee6829 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "ext-dom": "*", "phpcompatibility/php-compatibility": "^9.3", "squizlabs/php_codesniffer": "^3.6.1", - "rector/rector": "^0.16.0", + "rector/rector": "0.17.12", "symfony/polyfill": "^1.16", "phpcsstandards/phpcsutils": "^1.0.5" }, diff --git a/composer.lock b/composer.lock index 833823d8..daf77a82 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "85706157c667b84ac6386062a90f04cb", + "content-hash": "ed90b6398ecbe9407a63634ecf205431", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -284,21 +284,21 @@ }, { "name": "rector/rector", - "version": "0.16.0", + "version": "0.17.12", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f" + "reference": "af3a14a8a9fffa3100b730571c356f6c658d5e09" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/2125ff71ea05b079562a8f59ca48a97eb78dc07f", - "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/af3a14a8a9fffa3100b730571c356f6c658d5e09", + "reference": "af3a14a8a9fffa3100b730571c356f6c658d5e09", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.14" + "phpstan/phpstan": "^1.10.26" }, "conflict": { "rector/rector-doctrine": "*", @@ -310,11 +310,6 @@ "bin/rector" ], "type": "library", - "extra": { - "branch-alias": { - "dev-main": "0.15-dev" - } - }, "autoload": { "files": [ "bootstrap.php" @@ -333,7 +328,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.16.0" + "source": "https://github.com/rectorphp/rector/tree/0.17.12" }, "funding": [ { @@ -341,7 +336,7 @@ "type": "github" } ], - "time": "2023-05-05T12:12:17+00:00" + "time": "2023-08-10T15:22:02+00:00" }, { "name": "squizlabs/php_codesniffer", From cac60586a14e7420bc316acd9699b8dec575aaaf Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Fri, 15 Sep 2023 00:44:54 +0100 Subject: [PATCH 38/42] Allow more recent versions of rector --- composer.json | 2 +- composer.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index afee6829..3668d05d 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "ext-dom": "*", "phpcompatibility/php-compatibility": "^9.3", "squizlabs/php_codesniffer": "^3.6.1", - "rector/rector": "0.17.12", + "rector/rector": "^0.17.12", "symfony/polyfill": "^1.16", "phpcsstandards/phpcsutils": "^1.0.5" }, diff --git a/composer.lock b/composer.lock index daf77a82..dbe0c9be 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ed90b6398ecbe9407a63634ecf205431", + "content-hash": "2898da982b9bfa7d7caa896d1a5d8944", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -2385,5 +2385,5 @@ "ext-dom": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } From 8f01c09f3da14785754495420718ce56cf89a4b6 Mon Sep 17 00:00:00 2001 From: Pieter Hoste Date: Wed, 20 Sep 2023 16:58:09 +0200 Subject: [PATCH 39/42] Removing dependency on symfony/polyfill, is no longer required now that we dropped support for PHP 7.4 --- composer.json | 1 - composer.lock | 119 +------------------------------------------------- 2 files changed, 1 insertion(+), 119 deletions(-) diff --git a/composer.json b/composer.json index 3668d05d..7fb04c15 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,6 @@ "phpcompatibility/php-compatibility": "^9.3", "squizlabs/php_codesniffer": "^3.6.1", "rector/rector": "^0.17.12", - "symfony/polyfill": "^1.16", "phpcsstandards/phpcsutils": "^1.0.5" }, "require-dev": { diff --git a/composer.lock b/composer.lock index dbe0c9be..9ab29109 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2898da982b9bfa7d7caa896d1a5d8944", + "content-hash": "1a1a72f8272e9cd2cb0dd520a56aeea2", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -394,123 +394,6 @@ }, "time": "2022-06-18T07:21:10+00:00" }, - { - "name": "symfony/polyfill", - "version": "v1.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill.git", - "reference": "b78222a273aac3e5bab6358bf499d7f1fb88e48b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill/zipball/b78222a273aac3e5bab6358bf499d7f1fb88e48b", - "reference": "b78222a273aac3e5bab6358bf499d7f1fb88e48b", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "replace": { - "symfony/polyfill-apcu": "self.version", - "symfony/polyfill-ctype": "self.version", - "symfony/polyfill-iconv": "self.version", - "symfony/polyfill-intl-grapheme": "self.version", - "symfony/polyfill-intl-icu": "self.version", - "symfony/polyfill-intl-idn": "self.version", - "symfony/polyfill-intl-messageformatter": "self.version", - "symfony/polyfill-intl-normalizer": "self.version", - "symfony/polyfill-mbstring": "self.version", - "symfony/polyfill-php72": "self.version", - "symfony/polyfill-php73": "self.version", - "symfony/polyfill-php74": "self.version", - "symfony/polyfill-php80": "self.version", - "symfony/polyfill-php81": "self.version", - "symfony/polyfill-php82": "self.version", - "symfony/polyfill-php83": "self.version", - "symfony/polyfill-util": "self.version", - "symfony/polyfill-uuid": "self.version", - "symfony/polyfill-xml": "self.version" - }, - "require-dev": { - "symfony/intl": "^4.4|^5.0|^6.0", - "symfony/phpunit-bridge": "^5.3|^6.0", - "symfony/var-dumper": "^4.4|^5.1|^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - } - }, - "autoload": { - "files": [ - "src/bootstrap.php", - "src/Apcu/bootstrap.php", - "src/Ctype/bootstrap.php", - "src/Uuid/bootstrap.php", - "src/Iconv/bootstrap.php", - "src/Intl/Grapheme/bootstrap.php", - "src/Intl/Idn/bootstrap.php", - "src/Intl/Icu/bootstrap.php", - "src/Intl/MessageFormatter/bootstrap.php", - "src/Intl/Normalizer/bootstrap.php", - "src/Mbstring/bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\": "src/" - }, - "classmap": [ - "src/Intl/Icu/Resources/stubs", - "src/Intl/MessageFormatter/Resources/stubs", - "src/Intl/Normalizer/Resources/stubs", - "src/Php82/Resources/stubs", - "src/Php80/Resources/stubs", - "src/Php73/Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfills backporting features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compat", - "compatibility", - "polyfill", - "shim" - ], - "support": { - "issues": "https://github.com/symfony/polyfill/issues", - "source": "https://github.com/symfony/polyfill/tree/v1.27.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-11-10T10:11:03+00:00" - }, { "name": "webonyx/graphql-php", "version": "v15.0.0", From 045be185b47acbc1fe077eb175c225de279d950f Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 11 Jan 2022 22:05:24 +0000 Subject: [PATCH 40/42] Enforce consistent spacing around keywords --- eslint/.eslintrc-magento | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/.eslintrc-magento b/eslint/.eslintrc-magento index 8ae28b85..e74a6f95 100644 --- a/eslint/.eslintrc-magento +++ b/eslint/.eslintrc-magento @@ -19,7 +19,7 @@ "eqeqeq": [2, "smart"], "guard-for-in": 2, "indent": [2, 4], - "keyword-spacing": [2, {}], + "keyword-spacing": [2, {"after": true, "before": true}], "lines-around-comment": [ 2, { From 2a50cc7d2c671f3b1ad71b4b76faa50d4018a10f Mon Sep 17 00:00:00 2001 From: soumah Date: Thu, 30 Nov 2023 09:20:57 -0600 Subject: [PATCH 41/42] ACP2E-2635: Replace phpcompatibility/php-compatibility with magento/php-compatibility-fork * Fix fatal error in MethodAnnotationStructureSniff when there is no comment preceding a function or class method --- .github/workflows/php.yml | 2 +- .../MethodAnnotationStructureSniff.php | 27 ++++++++-- .../MethodAnnotationStructureUnitTest.inc | 54 ++++++++++++++++++- .../MethodAnnotationStructureUnitTest.php | 4 ++ Magento2/ruleset.xml | 2 +- composer.json | 10 ++-- composer.lock | 39 ++++++++------ 7 files changed, 110 insertions(+), 28 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 52b6a97f..9e9d024d 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -89,4 +89,4 @@ jobs: run: composer install - name: Run rector - run: vendor/bin/rector process Magento2 Magento2Framework PHP_CodeSniffer --dry-run --autoload-file vendor/squizlabs/php_codesniffer/autoload.php --autoload-file vendor/phpcompatibility/php-compatibility/PHPCSAliases.php + run: vendor/bin/rector process Magento2 Magento2Framework PHP_CodeSniffer --dry-run --autoload-file vendor/squizlabs/php_codesniffer/autoload.php --autoload-file vendor/magento/php-compatibility-fork/PHPCSAliases.php diff --git a/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php b/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php index d6f7ca3c..f4250a17 100644 --- a/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php +++ b/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php @@ -51,14 +51,33 @@ public function register() public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); - $commentStartPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, ($stackPtr), 0); - $commentEndPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, ($stackPtr), 0); - $prevSemicolon = $phpcsFile->findPrevious(T_SEMICOLON, $stackPtr, $commentEndPtr); - if (!$commentStartPtr || $prevSemicolon) { + $commentEndPtr = $stackPtr; + $tokensToFind = [ + \T_SEMICOLON, + \T_OPEN_CURLY_BRACKET, + \T_CLOSE_CURLY_BRACKET, + \T_ATTRIBUTE_END, + \T_DOC_COMMENT_CLOSE_TAG + ]; + + do { + $commentEndPtr = $phpcsFile->findPrevious($tokensToFind, $commentEndPtr - 1); + if ($commentEndPtr !== false + && $tokens[$commentEndPtr]['code'] === \T_ATTRIBUTE_END + && isset($tokens[$commentEndPtr]['attribute_opener']) + ) { + $commentEndPtr = $tokens[$commentEndPtr]['attribute_opener']; + } + } while ($commentEndPtr !== false && !in_array($tokens[$commentEndPtr]['code'], $tokensToFind, true)); + + if ($commentEndPtr === false || $tokens[$commentEndPtr]['code'] !== \T_DOC_COMMENT_CLOSE_TAG) { $phpcsFile->addError('Comment block is missing', $stackPtr, 'MethodArguments'); return; } + $commentStartPtr = $tokens[$commentEndPtr]['comment_opener'] + ?? $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, $commentEndPtr - 1); + if ($this->PHPDocFormattingValidator->hasDeprecatedWellFormatted($commentStartPtr, $tokens) !== true) { $phpcsFile->addWarning( 'Motivation behind the added @deprecated tag MUST be explained. ' diff --git a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc index 6402dad8..94512c01 100644 --- a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc +++ b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc @@ -1,5 +1,5 @@ 1, 10 => 1, 18 => 1, 30 => 1, @@ -40,6 +41,9 @@ public function getErrorList() 289 => 1, 298 => 1, 396 => 1, + 407 => 1, + 418 => 1, + 424 => 1, ]; } diff --git a/Magento2/ruleset.xml b/Magento2/ruleset.xml index e7ce2ee8..0090ed94 100644 --- a/Magento2/ruleset.xml +++ b/Magento2/ruleset.xml @@ -770,6 +770,6 @@ - +
diff --git a/composer.json b/composer.json index 7fb04c15..70878734 100644 --- a/composer.json +++ b/composer.json @@ -6,16 +6,16 @@ "AFL-3.0" ], "type": "phpcodesniffer-standard", - "version": "32", + "version": "33", "require": { "php": "~8.1.0 || ~8.2.0", "webonyx/graphql-php": "^15.0", "ext-simplexml": "*", "ext-dom": "*", - "phpcompatibility/php-compatibility": "^9.3", "squizlabs/php_codesniffer": "^3.6.1", "rector/rector": "^0.17.12", - "phpcsstandards/phpcsutils": "^1.0.5" + "phpcsstandards/phpcsutils": "^1.0.5", + "magento/php-compatibility-fork": "^0.1" }, "require-dev": { "phpunit/phpunit": "^9.5.10", @@ -36,8 +36,8 @@ } }, "scripts": { - "post-install-cmd": "vendor/bin/phpcs --config-set installed_paths ../../..,../../phpcompatibility/php-compatibility/PHPCompatibility", - "post-update-cmd": "vendor/bin/phpcs --config-set installed_paths ../../..,../../phpcompatibility/php-compatibility/PHPCompatibility" + "post-install-cmd": "vendor/bin/phpcs --config-set installed_paths ../../..,../../magento/php-compatibility-fork/PHPCompatibility", + "post-update-cmd": "vendor/bin/phpcs --config-set installed_paths ../../..,../../magento/php-compatibility-fork/PHPCompatibility" }, "config": { "allow-plugins": { diff --git a/composer.lock b/composer.lock index 9ab29109..9642857a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1a1a72f8272e9cd2cb0dd520a56aeea2", + "content-hash": "e110c856856bed580d6d373c21e4b90e", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -85,31 +85,37 @@ "time": "2023-01-05T11:28:13+00:00" }, { - "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", + "name": "magento/php-compatibility-fork", + "version": "v0.1.0", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + "url": "https://github.com/magento/PHPCompatibilityFork.git", + "reference": "1cf031c2a68e3e52e460c5690ed8d1d6d45f4653" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "url": "https://api.github.com/repos/magento/PHPCompatibilityFork/zipball/1cf031c2a68e3e52e460c5690ed8d1d6d45f4653", + "reference": "1cf031c2a68e3e52e460c5690ed8d1d6d45f4653", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.0.5", + "squizlabs/php_codesniffer": "^3.7.1" }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" + "replace": { + "phpcompatibility/php-compatibility": "*", + "wimg/php-compatibility": "*" }, "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcsstandards/phpcsdevcs": "^1.1.3", + "phpcsstandards/phpcsdevtools": "^1.2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4 || ^10.1.0", + "yoast/phpunit-polyfills": "^1.0.5 || ^2.0.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", @@ -133,18 +139,19 @@ "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" } ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility. This is a fork of phpcompatibility/php-compatibility", "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", "keywords": [ "compatibility", "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibility" }, - "time": "2019-12-27T09:44:58+00:00" + "time": "2023-11-29T22:34:17+00:00" }, { "name": "phpcsstandards/phpcsutils", From a72c1665e06a864dd1092342b178f71e454af48e Mon Sep 17 00:00:00 2001 From: soumah Date: Mon, 4 Dec 2023 11:28:59 -0600 Subject: [PATCH 42/42] ACP2E-2674: [MCS] Fix duplicate "Comment block is missing" --- Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php | 2 +- Magento2/ruleset.xml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php b/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php index f4250a17..a76240c7 100644 --- a/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php +++ b/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php @@ -71,7 +71,7 @@ public function process(File $phpcsFile, $stackPtr) } while ($commentEndPtr !== false && !in_array($tokens[$commentEndPtr]['code'], $tokensToFind, true)); if ($commentEndPtr === false || $tokens[$commentEndPtr]['code'] !== \T_DOC_COMMENT_CLOSE_TAG) { - $phpcsFile->addError('Comment block is missing', $stackPtr, 'MethodArguments'); + $phpcsFile->addError('Comment block is missing', $stackPtr, 'NoCommentBlock'); return; } diff --git a/Magento2/ruleset.xml b/Magento2/ruleset.xml index 0090ed94..4ac058c0 100644 --- a/Magento2/ruleset.xml +++ b/Magento2/ruleset.xml @@ -758,6 +758,8 @@ */Test/* *Test.php */PHPCSUtils/* + +