Skip to content

Upgrading phpstan/phpstan-deprecation-rules 1 to 2

Breaking1.2.1 → 2.0.5Breaking2Security2Deprecated1New5Changed12Fixed3Other33

BreakingUpgrade verdict

2 breaking changes and 2 security fixes.

  • A rule that flagged deprecated casts has been removed because the main PHPStan tool now handles this itself.
  • The old type hint deprecation rules are replaced by a new extension, which may change how deprecations are reported.
  • Hardens GitHub Actions workflows.
  • Removes PHPSTAN_BOT_TOKEN from checkout step.
5 items need code or config changes

PHP requirement changed in 2.0.0: ^7.2 || ^8.0 → ^7.4 || ^8.0.

Breaking2
Removes UsageOfDeprecatedCastRule because PHPStan already implements it via RestrictedMethodUsageExtension.
UsageOfDeprecatedCastRuleRestrictedMethodUsageExtension
Replaces TypeHintDeprecated*Rule with RestrictedDeprecatedClassNameUsageExtension.
TypeHintDeprecated*RuleRestrictedDeprecatedClassNameUsageExtension
Security2
Hardens GitHub Actions workflows.
Removes PHPSTAN_BOT_TOKEN from checkout step.
PHPSTAN_BOT_TOKEN
Deprecated1
Deprecates selectSingle().
selectSingle()