Skip to content

2.4.0

Choose a tag to compare

@Ocramius Ocramius released this 03 Jun 23:11
2.4.0
7a133e8

Build Status

This release introduces vimeo/psalm and PHPStorm-specific type-declarations for all API endpoints that do not return simple scalar/object types.

Effectively, that means that following code will now be statically analysable by psalm and PHPStorm, which will know the exact type of $proxy:

class MyExample
{
    public function bar(int $parameter) : void {}
}

$proxyFactory
    ->createProxy(MyExample::class)
    ->bar('hello world!'); // this will be detected as a type mismatch

In practice, this means that most projects won't need to use explicit inline type-hints such as /** @var SomeClassName $proxy */, and the tooling will pick up these types implicitly.

Improvements were also applied to type declarations in generated code, autoloading (now switched to PSR-4) and null-check ?? operator usages.

Total issues resolved: 9