Skip to content

Release PHPCSExtra 1.3.0 #332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 52 commits into from
Apr 20, 2025
Merged

Release PHPCSExtra 1.3.0 #332

merged 52 commits into from
Apr 20, 2025

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Apr 20, 2025

Release checklist

General

Release

  • Merge this PR
  • Make sure all CI builds are green.
  • Tag and create a release (careful, GH defaults to develop!) & copy & paste the changelog to it.
    ✏️ Check if anything from the link collection at the bottom of the changelog needs to be copied in!
  • Make sure all CI builds are green.
  • Close the milestone
  • Open a new milestone for the next release
  • If any open PRs/issues which were milestoned for this release did not make it into the release, update their milestone.
  • Fast-forward develop to be equal to stable

Publicize

jrfnl and others added 30 commits February 16, 2024 04:33
The `Universal.UseStatement.KeywordSpacing` sniff has a difference in behaviour between PHP < 8.0 and PHP 8.0+ due to the change in how namespaced name tokens are tokenized in PHP 8.0+.

For that reason, the `KeywordSpacingUnitTest.2.inc` did not have a ".fixed" file as whether or not a fix would be made depends on which PHP version the tests are being run on.

As of PHPCS 3.9.0, PHPCS will throw a PHPUnit warning for missing "fixed" files and as of PHPCS 4.0.0, this will become an error.

With that in mind, this commit adds the missing "fixed" file, but excludes that test from being run on PHP 8.0+ by overloading the `getTestFiles()` method and selectively removing the test case file from the list of files to test.
…phpcs-3.9.0

UseStatements/KeywordSpacing: add missing "fixed" test file
* The `--ignore-platform-req=php+` is no longer needed now PHPUnit 8 and 9 are supported (since PR 299 / PHPCS 3.8.0).
* Minor readability improvement of the script snippet.
Bumps [ramsey/composer-install](https://github.com/ramsey/composer-install) from 2 to 3.
- [Release notes](https://github.com/ramsey/composer-install/releases)
- [Commits](ramsey/composer-install@v2...v3)

---
updated-dependencies:
- dependency-name: ramsey/composer-install
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
…/ramsey/composer-install-3

GH Actions: Bump ramsey/composer-install from 2 to 3
Bumps [mondeja/remove-labels-gh-action](https://github.com/mondeja/remove-labels-gh-action) from 1 to 2.
- [Release notes](https://github.com/mondeja/remove-labels-gh-action/releases)
- [Commits](mondeja/remove-labels-gh-action@v1...v2)

---
updated-dependencies:
- dependency-name: mondeja/remove-labels-gh-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
…/mondeja/remove-labels-gh-action-2

GH Actions: Bump mondeja/remove-labels-gh-action from 1 to 2
... to comply with changes in Remark. _sigh_
…rkdown

Bug report template: tweak markdown
* Composer: avoid writing a lock file

* Allow use of Composer lock file in some tests
Okay, so apparently, there is a long-standing bug in the Microsoft package deploy process which caused `apt-get update` to fail in the first half hour after Microsoft has deployed a package.

The failure looks like this:
```
E: Failed to fetch https://packages.microsoft.com/ubuntu/22.04/prod/dists/jammy/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
```

As this only happens intermittently (after a MS package deploy), the chance of running into this bug are slim, but guess what: today I ran into it.

This change to the workflow is intended to prevent the next person running into this issue from having to waste time on figuring this out.

By splitting the "Install xmllint" step into two steps: one doing the `apt-get update` and one doing the actual install and making the first step one which is allowed to `continue-on-error`, this issue should hopefully not crop up anymore.

Any errors in the `apt-get update` step will now be ignored and as most errors which could potentially come from that step are irrelevant for the rest of the job anyway, this is fine.
If a relevant error would be surfaced, the next step (the xmllint install), will fail the job anyway.

Refs:
* actions/runner-images#3410
* dotnet/core#4167
…-bypass-apt-get-update

GH Actions: work around intermittent apt-get errors
* Double checked that all existing XML docs have the `xsi` attributes and schema reference on the `<documentation>` element.
* Verified that the contents of `<standard>` elements is consistently indented (with four spaces).
* Verified that all `<code>` `title` attributes use proper capitalization and punctuation.
…tency-fixes

Documentation: minor consistency fixes
…-minor-update

Release checklist: minor update
A number of reusable workflows have been introduced in the `PHPCSStandards/.github` repository for workflows used in multiple repos in this organisation, for which the steps are basically the same everywhere.

This will make maintenance of these workflows more straight-forward.

This commit switches a number of the basic QA workflows over to start using the reusable workflows.
Fix a few URLs which were being redirected.

Includes:
* Replacing badges from poser.pugx.org with badges using img.shields.io.
…sable-workflows

GH Actions/Basics: use reusable workflow & fix some URLs
... to satisfy shellcheck rule SC2086: "Double quote to prevent globbing and word splitting".

Ref: https://www.shellcheck.net/wiki/SC2086
This partially reverts commit f0f9421 (PR 317) after improvements upstream in the Remark no-dead-urls module.

Ref: remarkjs/remark-lint-no-dead-urls 54
…url-changes

Partially revert "README/Changelog: fix a few URLs which have changed"
While likely to be edge cases, there are a couple more tokens in which inline, non-indentation tabs can exist:
* `T_START_HEREDOC` and `T_START_NOWDOC` - between the `<<<` and the identifiers.
* `T_YIELD_FROM` - between the `yield` and the `from` keywords.

This updates the sniff to also handle those tokens.

Includes additional unit tests.

Loosely related to upstream changes which start doing tab replacement in these tokens too.
Note: this PR is _not_ dependent on the upstream changes and does not warrant raising the minimum supported PHPCS version.
…winlinetabs-handle-yield-from

Universal/DisallowInlineTabs: handle more tokens
Follow up on 320

The Tokenizer changes related to `yield from` with comments, which were expected to go into PHPCS 3.11.0, have been merged.

This updates the condition used in the tests to reflect the upstream change.
…winlinetabs-update-for-upstream-merge

Universal/DisallowInlineTabs: minor tweak to the tests
…file

This commit updates the sniff to use `return $phpcsFile->numTokens` instead of `return ($phpcsFile->numTokens + 1)`.

If a sniff file contains 50 tokens, the last `$stackPtr` will be 49, so returning `50` will already get us passed the end of the token stack and the `+ 1` is redundant.

Includes minor fix to the return type as the method never returns `void`.
…efunctionsfromoo-minor-fix

Universal/SeparateFunctionsFromOO: simplify skipping the rest of the file
jrfnl and others added 19 commits November 9, 2024 01:23
This Monday, [PHPStan 2.0 will be released](https://phpc.social/@OndrejMirtes/113441109253809720).

I've done some preliminary scans with PHPStan 2.0-dev to check if this would have an impact on this codebase and as things are, this would mean the build would start to fail.

For now, I'm proposing to make a small change in the GH Actions workflow to explicitly use PHPStan 1.x.

This buys us some time to evaluate PHPStan 2.0 properly and to make any changes needed to make the codebase compatible with PHPStan 2.x when we're ready for it.

Note:
At least one of the new issues reported has been identified as a bug and reported to PHPStan: phpstan/phpstan#11980
…stan-1.0

GH Actions: use explicit PHPStan major
PHPStan 2.0 has been released 🎉

This commit makes the necessary updates to switch to PHPStan 2.0.

Includes normalizing slashes in path references in the PHPStan config file.

Refs:
* https://phpstan.org/blog/phpstan-2-0-released-level-10-elephpants
* https://github.com/phpstan/phpstan/blob/2.0.x/UPGRADING.md
* https://github.com/phpstan/phpstan/releases/tag/2.0.0
... which is expected later this month.

* Builds against PHP 8.4 are no longer allowed to fail.
* Update PHP version on which code coverage is run (high should now be 8.4).
* Add _allowed to fail_ build against PHP 8.5.
* Update the "tested against" badge in the README.
…il-on-8.4

GH Actions: update for the release of PHP 8.4
The intention is for there to be a dedicated action runner available at some point for XML code style checking, so let's move this to a separate job.

Also see: PHPCSStandards/PHPCSDevTools#145
Instead of doing all the installation steps for xmllint validation in the workflow, use the ✨ new dedicated `phpcsstandards/xmllint-validate` action runner instead.

Ref: https://github.com/marketplace/actions/xmllint-validate
…xmllint-validation

GH Actions: use the xmllint-validate action runner and enhance checks
... to forbid using `true`, `false` and `null` as fully qualified constants.

Includes fixer.
Includes unit tests.
Includes documentation.

Note: yes, there is a related tokenizer issue in PHPCS where these tokens are not tokenized the same PHP cross-version, however, the tokenization will change in PHPCS 4.0 as well, so there isn't much point addressing that now as it would just make things even more complicated for sniffs come PHPCS 4.0.

And yes, this does mean that this sniff will need adjusting for PHPCS 4.0.
…alse-null

✨ New Universal.PHP.NoFQNTrueFalseNull sniff
... which is the latest release containing tokenizer changes.

Includes removing some code which has become redundant after upstream PR PHPCSStandards/PHP_CodeSniffer 647 was merged (included in 3.11.0).
…pcs-version

Composer: raise the minimum supported PHPCS version to 3.12.1
PHP 8.2 introduced DNF types, which use parenthesis.

This commit adds support to the `Universal.Operators.TypeSeparatorSpacing` sniff to also check the spacing around the parenthesis for DNF types.

Notes:
* Allows for a new line before the start of a type for function parameters.
* Expects one space before the type operator if the type starts with a DNF open parenthesis.
* Expects one space after the type operator if the type ends on a DNF close parenthesis.
* Includes protection against throwing two errors for the same issue, like when a DNF close parenthesis if followed by a union type operator and there is whitespace between these.

Includes tests.
Includes updated documentation.
…ratorspacing-support-dnf-types

Universal/TypeSeparatorSpacing: add support for PHP 8.2 DNF types
@jrfnl jrfnl added this to the 1.3.0 milestone Apr 20, 2025
@jrfnl jrfnl merged commit 46d08eb into stable Apr 20, 2025
43 checks passed
@jrfnl
Copy link
Member Author

jrfnl commented Jun 14, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants