timeweb/phpstan-enum

Prepare for PHPStan 1.0

ondrejmirtes opened this issue ยท 1 comments

Hello everyone ๐Ÿ‘‹

I announced today that PHPStan 1.0 is going to be released on November 1st 2021.

I'm approaching you as one of the most popular PHPStan extensions. I'd love if you could prepare your code for PHPStan 1.0 in advance so that it's ready to release on the same day.

Here's a brief guide how to approach the upgrade:

  1. Create a branch ๐ŸŒด
  2. Update your composer.json to "phpstan/phpstan": "^1.0", add "minimum-stability": "dev" and "prefer-stable": true if necessary.
  3. Update your code with the BC breaks below in mind. ๐Ÿ”ง
  4. Fix the code so that it passes PHPStan's analysis ๐Ÿค“
  5. Wait for PHPStan 1.0 release on November 1st, merge your branch and tag the next major version ๐Ÿ‘

Thank you!


Here are the BC breaks. The list is huge but most of those have very little impact.

There are new rules around using PHPStan internals in regard to backward compatibility promise: https://phpstan.org/developing-extensions/backward-compatibility-promise

It's possible that not everything you use is covered by it - so I'm here to help you to transition to correct usage, or add some @api annotations in PHPStan itself so that more is covered by the promise. Let me know!

BC breaks for end-users

The following are interesting only if you create a custom ruleset in your configuration file:

BC breaks for extension developers

@samizdam Hi, so this is currently the last package holding me back from updating to PHPStan 1.0 and I can see that you already worked on this shortly after the issue got opened about a month ago but since then there's no progress visible, so I'm wondering about the status. Are there still any blockers?