Skip to content

Upgrading vimeo/psalm 6 to 7

Breaking6.21.2 → 7.16.0Breaking6Platform3Deprecated3New178Changed95Fixed1113Other218

Fetching 79 releases from GitHub…78 / 79
BreakingUpgrade verdict

6 breaking changes and 2 platform requirement changes.

  • The old purity annotations are replaced by a new capability system where functions declare exactly which side effects they may have.
  • Plugins must now depend on the psalm/psalm-plugin-api metapackage with a caret range, because the plugin API can break in any Psalm release, including minor and patch versions.
  • This major version has changes that may require you to update your code or configuration.
  • If you relied on the compact output format, it is now called table; compact now produces a different, more compact output.
Top 5 of 11 that need code or config changes

vimeo/psalm publishes official migration guides for versions 7, 7. They cover more than the release notes do.

Upgrade guide ↗Migration guide ↗

No longer states a PHP requirement from 7.0.0-rc3 (was ~8.1.31 || ~8.2.27 || ~8.3.16 || ~8.4.3 || ~8.5.0).

Adds psalm/plugin-laravel ^4.22.7, psalm/plugin-mockery ^1.3.2, psalm/plugin-phpunit ^0.21 || ^0.22 || ^1.0, psalm/plugin-symfony ^5.9.1, psalm/psalm-plugin-api 0.5.1, symfony/polyfill-php85 ^1.43, symfony/polyfill-php86 ^1.43, weirdan/doctrine-psalm-plugin ^2.12.0.

Drops dnoegel/php-xdg-base-dir.

Moves amphp/parallel ^2.3 → ^2.4.0, fidry/cpu-core-counter ^0.4.1 || ^0.5.1 || ^1.0.0 → ^1.2, nikic/php-parser ^5.2.0 → ^5.9. Your build may pick other versions.

Breaking6
Replaces @psalm-pure, @psalm-mutation-free and @psalm-external-mutation-free with capabilities: read-props, write-this-props, write-props, read-globals, write-globals, write-refs, io and time, with…
@psalm-pure@psalm-mutation-free@psalm-external-mutation-free@psalm-capabilitiesread-propswrite-this-propswrite-propsread-globals
Psalm's version number no longer tracks the plugin API; breaking plugin API changes may ship in any release, tracked by psalm/psalm-plugin-api.
psalm/psalm-plugin-api
Psalm v7 introduces breaking changes from v6, listed in UPGRADING.md.
The old compact output format is renamed table, and a new truly compact compact format is added.
compacttable
Renames the compact output format to table and adds a new truly compact format.
compacttable
Renames Capabilities::allows to Capabilities::allowsAnyOf.
Capabilities::allowsCapabilities::allowsAnyOf
Platform2
Accepts PHP 8.6 as an analysis target and requires nikic/php-parser ^5.9.
nikic/php-parser
Adds PHP 8.5 support.
Deprecated3
Reports string increments as deprecated since PHP 8.5 and suggests str_increment().
str_increment()
Reports string increments as deprecated since PHP 8.5 (backport).
Deprecates reflection's setAccessible on PHP 8.1.
setAccessible