This prevents issues with incompatible `phpstan/phpdoc-parser`.
`slevomat/coding-standard:8.3` claimed compatibility with
`phpstan/phpdoc-parser:^1.6`, but it fails with a fatal error when
`phpstan/phpdoc-parser:1.14` is installed (apparently there was a BC
break in a minor version of `phpstan/phpdoc-parser`).
Since 8.4 slevomat/coding-standard adopted a more conservative
dependency strategy, and they don't allow new untested versions of
`phpstan/phpdoc-parser`.
8.4 still allows PHP 7.2, so we should have no problems due to 7.x
removal.
Variables in PHP are not namespaced. In other words, namespaces share
the context with the file they are located in.
See https://3v4l.org/2qvrCFixesvimeo/psalm#8778
Previously `psalter` would only replace the first occurence of the
property access. Now it replaces all properties (by keeping the old name
unknown in the context).
`vendor/autoload/check_platform.php` may be disabled by the user
`composer.json`, so we have to repeat the check for runtime
requirements.
Fixesvimeo/psalm#7560
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.
Fixesvimeo/psalm#7606Fixesvimeo/psalm#5399
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.
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.