packagist phpstan/phpstan 1.3.0

latest releases: 1.11.x-dev, dev-renovate/major-website, dev-renovate/major-playground-api...
2 years ago

Major new features 🚀

  • Support for PHP 8.1 Enums - RFC
  • Upgraded Roave/BetterReflection to 5.0.0
    • PHP 7.1+ is still supported because the dependency is downgraded automatically in our own fork
    • This brings plenty of bugfixes, for example PHP 8.0 Attributes can now be read in static reflection context
  • PHPStan now works when OPCache is enabled!
  • The development repository phpstan/phpstan-src is now PHP 8.0+ only, while the distribution package phpstan/phpstan still supports PHP 7.1+.
    • This is achieved thanks to automatic downgrade of source code using Rector during PHAR compilation
    • PHPStan now ships with Symfony PHP polyfills for PHP 7.2-8.0.

Improvements 🔧

  • Update nikic/php-parser to 4.13.2 (phpstan/phpstan-src@8939964)
  • Update to Symfony 5.4 (#863)
  • CLI option --allow-empty-baseline to allow generating empty baseline (#776), thanks @Lctrs!
  • Support for @phpstan-property, @phpstan-property-read, and @phpstan-property-write (#775), thanks @mad-briller!
  • Add support for the key-of<...> and value-of<...> types (#800), thanks @ste93cry!
  • GithubErrorFormatter > Allow any ErrorFormatter (#854), thanks @ruudk!
  • Array unpacking support for string-keyed arrays (#803), thanks @canvural!
  • Moved some classes from ClassBlacklistReflectionProvider to staticReflectionClassNamePatterns config so that they are in effect for ClassBlacklistSourceLocator too (phpstan/phpstan-src@e40ba15)
  • PHPStanTestCase: Added a helper method to assert no errors happend (#894), thanks @staabm!

Bugfixes 🐛

Function signature fixes 🤖

  • Added DynamicReturnTypeExtension for trigger_error (#766), thanks @staabm!
  • The array returned by array_count_values() can never contain a zero. (#773), thanks @johnbillion!
  • Add ThrowableReturnTypeExtension (#795), thanks @herndlm!
  • Update functionMap for XSLTProcessor (#797), thanks @hbrecht!
  • imap_delete / imap_undelete: correction (#799), thanks @hbrecht!
  • Fix the signature of the value returned from the date_parse and date_parse_from_format functions (#807), thanks @ste93cry!
  • Fix the signature of get_resources() (#837), thanks @MidnightDesign!
  • Fix preg_filter function signature (#826), thanks @johnstevenson!
  • Fix ldap_set_rebind_proc signature (#851), thanks @villfa!
  • restore_error_handler and restore_exception_handler always return boolean true. (#850), thanks @johnbillion!
  • More specific return types for some DateTimeZone methods (#857), thanks @johnbillion!
  • Add missing Set::map() method to ext-ds stub (#855), thanks @simPod!
  • Support variable constant flags in preg_split (phpstan/phpstan-src@a16c7ae), thanks @clxmstaab!

Don't miss a new phpstan release

NewReleases is sending notifications on new releases.