diff --git a/.github/workflows/basics.yml b/.github/workflows/basics.yml index c619d6b4..3fa103ae 100644 --- a/.github/workflows/basics.yml +++ b/.github/workflows/basics.yml @@ -71,9 +71,7 @@ jobs: # Check the code-style consistency of the XML file. - name: Check XML code style - run: | - diff -B ./PHPCSUtils/ruleset.xml <(xmllint --format "./PHPCSUtils/ruleset.xml") - diff -B ./PHPCS23Utils/ruleset.xml <(xmllint --format "./PHPCS23Utils/ruleset.xml") + run: diff -B ./PHPCSUtils/ruleset.xml <(xmllint --format "./PHPCSUtils/ruleset.xml") # Check the code-style consistency of the PHP files. - name: Check PHP code style diff --git a/PHPCS23Utils/Sniffs/Load/LoadUtilsSniff.php b/PHPCS23Utils/Sniffs/Load/LoadUtilsSniff.php deleted file mode 100644 index 3f8ea5ab..00000000 --- a/PHPCS23Utils/Sniffs/Load/LoadUtilsSniff.php +++ /dev/null @@ -1,52 +0,0 @@ - - - Standard which makes the PHPCSUtils utility methods for external PHPCS standards available in PHPCS 2.x. - diff --git a/Tests/bootstrap.php b/Tests/bootstrap.php index 8e660fb9..5666e772 100644 --- a/Tests/bootstrap.php +++ b/Tests/bootstrap.php @@ -97,9 +97,7 @@ } /* - * Alias the PHPCS 2.x classes to their PHPCS 3.x equivalent if necessary. - * - * Also alias the non-namespaced PHPUnit 4.x/5.x test case class to the + * Alias the non-namespaced PHPUnit 4.x/5.x test case class to the * namespaced PHPUnit 6+ version. */ require_once \dirname(__DIR__) . '/phpcsutils-autoload.php'; diff --git a/phpcsutils-autoload.php b/phpcsutils-autoload.php index 8135432b..0857fd10 100644 --- a/phpcsutils-autoload.php +++ b/phpcsutils-autoload.php @@ -8,12 +8,6 @@ * - If an external standard only supports PHPCS >= 3.1.0 and uses the PHPCS * native unit test framework, this file does not need to be included. * - * - When PHPCS 2.x support is desired, include the `"PHPCS23Utils"` standard - * in the ruleset of the external standard and this file will be included - * automatically. - * Including this file will allow PHPCSUtils to work in both PHPCS 2.x - * as well as PHPCS 3.x. - * * - If an external standard uses its own unit test setup, this file should * be included from the unit test bootstrap file. * @@ -52,52 +46,6 @@ define('PHPCSUTILS_AUTOLOAD', true); } -if (defined('PHPCSUTILS_PHPCS_ALIASES_SET') === false) { - /* - * Alias a number of PHPCS 2.x classes to their PHPCS 3.x equivalents. - * - * {@internal The PHPCS file have been reorganized in PHPCS 3.x, quite - * a few "old" classes have been split and spread out over several "new" - * classes. In other words, this will only work for a limited number - * of classes.}} - * - * {@internal The `class_exists` wrappers are needed to play nice with other - * external PHPCS standards creating cross-version compatibility in a - * similar manner.}} - */ - if (interface_exists('\PHP_CodeSniffer_Sniff') === true - && interface_exists('\PHP_CodeSniffer\Sniffs\Sniff') === false - ) { - class_alias('\PHP_CodeSniffer_Sniff', '\PHP_CodeSniffer\Sniffs\Sniff'); - } - - if (class_exists('\PHP_CodeSniffer_File') === true - && class_exists('\PHP_CodeSniffer\Files\File') === false - ) { - class_alias('\PHP_CodeSniffer_File', '\PHP_CodeSniffer\Files\File'); - } - - if (class_exists('\PHP_CodeSniffer_Tokens') === true - && class_exists('\PHP_CodeSniffer\Util\Tokens') === false - ) { - class_alias('\PHP_CodeSniffer_Tokens', '\PHP_CodeSniffer\Util\Tokens'); - } - - if (class_exists('\PHP_CodeSniffer_Exception') === true - && class_exists('\PHP_CodeSniffer\Exceptions\RuntimeException') === false - ) { - class_alias('\PHP_CodeSniffer_Exception', '\PHP_CodeSniffer\Exceptions\RuntimeException'); - } - - if (class_exists('\PHP_CodeSniffer_Exception') === true - && class_exists('\PHP_CodeSniffer\Exceptions\TokenizerException') === false - ) { - class_alias('\PHP_CodeSniffer_Exception', '\PHP_CodeSniffer\Exceptions\TokenizerException'); - } - - define('PHPCSUTILS_PHPCS_ALIASES_SET', true); -} - if (defined('PHPCSUTILS_PHPUNIT_ALIASES_SET') === false) { /* * Alias the PHPUnit 4/5 TestCase class to its PHPUnit 6+ name.