Skip to content

0.12.9

Compare
Choose a tag to compare
@ondrejmirtes ondrejmirtes released this 04 Feb 23:15
0.12.9
297cb24

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!