PHPStan v0.12.9 Release Notes

Release Date: 2020-02-04 // over 4 years ago
  • ๐Ÿฑ Major new features ๐Ÿš€

    ๐Ÿ‘Œ Support for custom type aliases (phpstan/phpstan-src@3151160)

    ๐Ÿ”ง Type aliases (also known as typedef) are a popular feature in other languages like TypeScript or C++. Using the following configuration in phpstan.neon will allow you to reference these types in your PHPDocs:

    parameters: typeAliases: Name: 'string'NameResolver: 'callable(): string'NameOrResolver: 'Name|NameResolver'
    
    /\*\* \* @param NameOrResolver $arg \*/function foo($arg){// $arg is string|(callable(): string)}
    

    The development of this feature was sponsored by @tslettebo.

    ๐ŸŽ Several performance optimizations - you should see performance improvements between 10โ€“20%:

    ๐Ÿ‘Œ Improvements ๐Ÿ”ง

    ๐Ÿ›  Bugfixes ๐Ÿ›

    ๐Ÿฑ Function signature fixes ๐Ÿค–

    • zlib_decode() may return FALSE on corrupted data (#113), thanks @dktapps!
    • ๐Ÿ›  Fix ext-ds object diffing and merging (#95), thanks @simPod!
    • ext-ds stubs improvements (#126), thanks @enumag!
    • Correct Phar::decompress() return data type (#114), thanks @peter-gribanov!
    • โž• added generic stub for SplFixedArray (#117), thanks @dktapps!