Skip to content

Upgrade humbug/box#8770

Merged
weirdan merged 5 commits intovimeo:masterfrom
weirdan:upgrade-humbug-box
Nov 26, 2022
Merged

Upgrade humbug/box#8770
weirdan merged 5 commits intovimeo:masterfrom
weirdan:upgrade-humbug-box

Conversation

@weirdan
Copy link
Copy Markdown
Collaborator

@weirdan weirdan commented Nov 26, 2022

This PR updates humbug/box and fixes issues with the version Psalm reports when it's built as PHAR.

Fixes #7606
Fixes #5399
Fixes #7314

Obtaining package version data from within a scoped PHAR file is a
complicated topic, and it's been alternatively broken and fixed multiple
times.

This change moves version data access to a single class, so that we can
fix it there should we need to.

The rest of the code can just rely on PSALM_VERSION constant (which will
be made unscoped in a further commit) or call `VersionUtils` methods.
It updates humbug/scoper as well, so some changes to scoper
configuration are required.

`PSALM_VERSION` and `PHP_PARSER_VERSION` constants are made unscoped to
prevent various issues.
Compatibility between `ocramius/package-versions`,
`composer/package-versions-deprecated`, `composer-runtime-api` and
`humbug/box` (with `humbug/scoper` further complicating things)has been
always a problematic area. So instead of trying to keep up with all the
changes in all of those packages, we will now bake the version data (for
the packages we need) into the PHAR file itself.

Fixes vimeo#7606
Fixes vimeo#5399
@weirdan weirdan added the release:fix The PR will be included in 'Fixes' section of the release notes label Nov 26, 2022
@weirdan weirdan merged commit c3cc906 into vimeo:master Nov 26, 2022
@weirdan weirdan deleted the upgrade-humbug-box branch November 26, 2022 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:fix The PR will be included in 'Fixes' section of the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Psalm 4.20.0 PHAR does not report correction version Update humbug/box Wrong version when using PHAR distribution

1 participant