"...fd.git" did not exist on "dd9a825210ccd1eae6f6c10803771f5fa96a73d9"
- 09 Oct, 2022 2 commits
-
-
Wim Godden authored
Tests: drop support for PHPCS 2.x from the BaseSniffTest class
-
jrfnl authored
Note: dropping the `parent::setUpPHPCS()` calls is fine, the methods run due to the `@before` annotations and no longer need to overload a non-existent parent method.
-
- 07 Oct, 2022 25 commits
-
-
Wim Godden authored
CI: run code coverage on PHPUnit 9.3+ and against PHP 8.1
-
jrfnl authored
As of PHPUnit 9.3, PHPUnit started using PHP-Parser as a basis to calculate code coverage. This prevented this repo from using PHPUnit 9.3 (see PR PHPCSStandards/PHPCSUtils 304 for more details) as PHP Parser also backfills tokens and that interfered with the sniffs. Now support for PHPCS < 3.7.1 has been dropped though, all tokens should exist in PHPCS. And if in the future we would need to do "does this token exist ?" checks again, PHPCSUtils will provide a `TokenHelper::tokenExists()` method (as of version 1.0.0-alpha4), which will allow us to distinguish between tokens backfilled by PHPCS and tokens backfilled by PHP-Parser. PHPUnit itself has also added a new feature in PHPUnit 9.3.4 to warm the code cache ahead of running tests recording code coverage. Using that feature should prevent the token interference completely, but implementing it was a bit of an experiment as the feature is barely documented. Either way, the combination of the above, allows us to: * Remove the tweaking of the PHPUnit version in `test` jobs in GH Actions. * Run code coverage on the latest PHP version (8.1). Notes regarding cache-warming: * The `--coverage-cache` and `--warm-coverage-cache` options are available since PHPUnit 9.3.4 and if these are used on older PHPUnit versions, PHPUnit will error out with an "unrecognized CLI argument" error. * In other words: these options can only be used with PHPUnit 9.3+, which is why the PHPUnit version is checked and remembered and subsequently used in the conditions. * Also: running PHPUnit with the `--warm-coverage-cache` option _does not run the tests_. It literally only warms the cache, which is why this is implemented as a separate step in the workflow. * The cache directory can be configured in the `phpunit.xml[.dist]` file, but only when using the PHPUnit 9.3+ `coverage` XML tag. As the PHPUnit config used by PHPCompatibility needs to stay cross-version compatible with older PHPUnit versions, the CLI option is used for now. If, at some point in the future, two config files would be used (one for PHPUnit < 9.3 and one for PHPUnit >= 9.3), the cache directory could be added to the config instead of passing it on the command-line. Refs: * https://github.com/sebastianbergmann/php-code-coverage/issues/798#issuecomment-678922065 * https://github.com/sebastianbergmann/phpunit/compare/9.3.3...9.3.4
-
jrfnl authored
... at the end of test runs run with code coverage.
-
Wim Godden authored
Sniffs: remove work-arounds for PHPCS < 3.7.1
-
Wim Godden authored
Tests: start using the PHPUnit Polyfills
-
jrfnl authored
-
jrfnl authored
-
jrfnl authored
-
jrfnl authored
-
jrfnl authored
-
jrfnl authored
-
jrfnl authored
-
jrfnl authored
Note: I've not removed the "token translation" _logic_ as we're likely to need it again soon enough with how fast PHP is introducing changes. Be aware that that means this code will now show as "uncovered" in the code coverage report.
-
jrfnl authored
`T_YIELD` and `T_YIELD_FROM` have been tokenized correctly since PHPCS 3.1.0.
-
jrfnl authored
-
jrfnl authored
-
jrfnl authored
-
jrfnl authored
-
jrfnl authored
The `T_RETURN_TYPE` token was deprecated in PHPCS 3.3.0 and is no longer used.
-
jrfnl authored
-
jrfnl authored
-
jrfnl authored
... in favour of using the PHPUnit Polyfills.
-
jrfnl authored
... to always check that a `composer install` has been run and to load the PHPUnit Polyfill autoloader directly when running PHPUnit via a Phar file as the Polyfill library needs to be installed and its autoload file loaded for the tests to work correctly. Includes some minor tidying up: * Remove redundant use of `DIRECTORY_SEPARATOR`. * Remove use of FQN function names (as file is not namespaced).
-
jrfnl authored
... so we no longer have to have our own work-arounds for various PHPUnit versions in the test suite. While generally speaking, the `require-dev` for PHPUnit should now be removed, I'm leaving it in place due to the PHPUnit >= 9.3.0 issue with PHP-Parser backfilling tokens. If/when that issue is resolved in the future, the direct requirement for PHPUnit can be removed.
-
Wim Godden authored
Drop support for PHPCS < 3.7.1
-
- 30 Sep, 2022 3 commits
-
-
jrfnl authored
-
jrfnl authored
PHPCSDevCS was previously not added to the `require-dev` dependencies as the minimum supported PHPCS version conflicted with the minimum supported PHPCS version of this package. Now this is no longer the case, the package can be safely added to `require-dev` and work-arounds can be removed. Note: includes declaring a `COMPOSER_ROOT_VERSION` environment variable in the test workflows as PHPCompatibility is a dependency of PHPCSDevCS and having the `COMPOSER_ROOT_VERSION` environment variable prevents a conflict due to the circular dependency.
-
jrfnl authored
This: * Updates the minimum PHPCS requirement in `composer.json`, the `README` and the `CONTRIBUTING` docs. Includes removing some phrases which referenced use of older PHPCS versions. * Updates the GH Actions scripts to no longer test against PHPCS < 3.7.1. Includes: - Removing a work-around which was in place for a dependency which isn't compatible with PHPCS 2.x. - Minor simplification for the `quicktest` script regarding whether or not to run linting. * Updates the `LowPHPCS` sniff to reflect the new minimum and recommended PHPCS version. This sniff will now not trigger any errors anymore, however, I recommend leaving the sniff in place for now for future "resurrection". * No need to include the `PHPCSUtils23` ruleset anymore (which added aliases for PHPCS 2.x classes). * Add PHPCSDevCS to the Composer `require-dev` dependencies, now there is no longer a conflict with the minimum supported PHPCS version. Includes removing work-arounds for this from the Composer scripts and in the workflows.
-
- 23 Sep, 2022 3 commits
-
-
Juliette authored
Composer/GH Actions: start using PHPCSDevTools 1.2.0
-
jrfnl authored
Includes adding the `<?xml..?>` header if it didn't exist in the file.
-
jrfnl authored
PHPCSDevTools 1.2.0 introduces an XSD for the XML docs which can accompany sniffs. This commit: * Updates the PHPCSDevTools to version 1.2.0. * Adds a new check against the XSD for all sniff XML Docs files. Ref: https://github.com/PHPCSStandards/PHPCSDevTools/releases/tag/1.2.0
-
- 04 Sep, 2022 3 commits
-
-
Juliette authored
Composer: update PHP Parallel Lint and Console Highlighter
-
Juliette authored
Add "static analysis" Composer keyword
-
Gary Jones authored
As per https://getcomposer.org/doc/04-schema.md#keywords by including "static analysis" as a keyword in the `composer.json` file, Composer 2.4.0-RC1 and later will prompt users if the package is installed with `composer require` instead of `composer require --dev`. See https://github.com/composer/composer/pull/10960 for more info.
-
- 24 Apr, 2022 2 commits
-
-
jrfnl authored
While rare, there are some deprecations which PHP can show when a file is being linted. By default these are ignored by PHP-Parallel-Lint. Apparently though, there is an option to show them (wasn't documented until recently), so let's turn that option on.
-
jrfnl authored
PHP Console Highlighter has released version `1.0.0` and PHP Parallel Lint version `1.3.2` is the first PHP Parallel Lint version which supports PHP Console Highlighter `1.0.0`. As the minimum supported PHP version is still PHP 5.3 for both, we can safely update both dependency requirements. Refs: * https://github.com/php-parallel-lint/PHP-Console-Highlighter/releases/tag/v1.0.0 * https://github.com/php-parallel-lint/PHP-Parallel-Lint/releases/tag/v1.3.2
-
- 14 Apr, 2022 2 commits
-
-
Wim Godden authored
PHP 8.1: New `PHPCompatibility.Classes.NewFinalClassConstants` sniff
-
Wim Godden authored
Merge pull request #1331 from PHPCompatibility/feature/newmagicmethods-dont-throw-warning-for-serializable-with-magic FunctionNameRestrictions/NewMagicMethods: special case the magic __[un]serialize() methods
-