Skip to content
Snippets Groups Projects
Commit d446c811 authored by David Prévot's avatar David Prévot
Browse files

Merge tag '2.4.0' into upstream

This release introduces [vimeo/psalm](https://github.com/vimeo/psalm) and
[PHPStorm](https://www.jetbrains.com/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`:

```php
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**

- [359: Extend date for bug fixes and security fixes for the 2.x series](https://github.com/Ocramius/ProxyManager/pull/359) thanks to @malukenho
- [360: README.md fix FQCN usage](https://github.com/Ocramius/ProxyManager/pull/360) thanks to @Slamdunk
- [408: Add return type `self` to generated method](https://github.com/Ocramius/ProxyManager/pull/408) thanks to @malukenho
- [426: Replace one ?: by ?? for consistency](https://github.com/Ocramius/ProxyManager/pull/426) thanks to @nicolas-grekas
- [428: Moved to psr-4](https://github.com/Ocramius/ProxyManager/pull/428) thanks to @samnela
- [429: #426 replace falsey check (`?:`) with null coalesce (`??`) operations](https://github.com/Ocramius/ProxyManager/pull/429) thanks to @Ocramius
- [453: Bump dependencies/CS standard/add typed properties](https://github.com/Ocramius/ProxyManager/pull/453) thanks to @Ocramius
- [463: Provide `@psalm-param class-string<T>` documentation for proxy factories and anything type-hinted `object` and `: object`](https://github.com/Ocramius/ProxyManager/issues/463) thanks to @Ocramius
- [465: #463: psalm-specific type declarations for generic/intersection types of proxies](https://github.com/Ocramius/ProxyManager/pull/465) thanks to @Ocramius

# gpg: Signature faite le lun. 03 juin 2019 13:10:01 -10
# gpg:                avec la clef RSA 969287AB0A84CAAE3F48A69C4167D3337FD9D629
# gpg: Bonne signature de « Marco Pivetta (Ocramius) <ocramius@gmail.com> » [inconnu]
# gpg:                 alias « [jpeg image of size 3228] » [inconnu]
# gpg:                 alias « [jpeg image of size 12261] » [inconnu]
# gpg: Attention : cette clef n'est pas certifiée avec une signature de confiance.
# gpg:             Rien n'indique que la signature appartient à son propriétaire.
# Empreinte de clef principale : 7BB9 B50F E8E0 2118 7914  A5C0 9F65 FBC2 12EC 2DF8
#    Empreinte de la sous-clef : 9692 87AB 0A84 CAAE 3F48  A69C 4167 D333 7FD9 D629
parents f35d34c6 7a133e8d
No related branches found
No related tags found
No related merge requests found
Showing
with 430 additions and 202 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment