PHPStan v0.12.33 Release Notes

Release Date: 2020-07-19 // almost 4 years ago
  • ๐Ÿ‘Œ Improvements ๐Ÿ”ง

    • ๐ŸŽ‰ Initial PHP 8 support!
    • Set different PHP version than your runtime
      • If you set different phpVersion parameter in your phpstan.neon, you can for example tell PHPStan to analyse source code like it's written for PHP 7.4 even if you're running PHP 8. The phpVersion config parameter is in PHP_VERSION_ID format - for PHP 7.4, use 70400.
      • You can also set a newer PHP version. So you can run PHPStan on 7.4, but already test compatibility with PHP 8 by setting phpVersion to 80000.
    • Check uninitialized typed properties that aren't set in the constructor (phpstan/phpstan-src@a1eb1f5), #2984
      • Off by default, needs checkUninitializedProperties: true.
    • ๐Ÿ‘‰ Show error on unescaped () in ignoreErrors (phpstan/phpstan-src@8479d40), #3602

    ๐Ÿฑ Bleeding edge ๐Ÿ”ช

    ๐Ÿ‘€ If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's phpstan.neon:

    includes:
        - vendor/phpstan/phpstan/conf/bleedingEdge.neon
    

    Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included.

    ๐Ÿ›  Bugfixes ๐Ÿ›

    • ๐Ÿ—„ Skip not deprecated methods (#267), thanks @malarzm!
    • Type aliases cannot be used internally because they might clash with an existing class name (phpstan/phpstan-src@4d08280), #3569
    • ๐Ÿ›  Fix covariant type check when template has bound (#272), thanks @hrach!

    ๐Ÿฑ Function signature fixes ๐Ÿค–