mirror of
https://github.com/danog/Valinor.git
synced 2024-11-30 04:39:05 +01:00
feat: simplify type signature of TreeMapper#map()
This also brings `TreeMapper#map()` closer to PHPStorm support, whilst still benefiting from more precise `vimeo/psalm:4.18.x` types thanks to the conditional return specification. Ref: https://github.com/CuyZ/Valinor/pull/59#discussion_r782362428
This commit is contained in:
parent
f9b04c5c27
commit
e280033941
@ -8,16 +8,15 @@ namespace CuyZ\Valinor\Mapper;
|
||||
interface TreeMapper
|
||||
{
|
||||
/**
|
||||
* @psalm-template TObject of object
|
||||
* @psalm-template TypeDefinition of string|class-string<TObject>
|
||||
* @template T of object
|
||||
*
|
||||
* @param TypeDefinition $signature
|
||||
* @param string|class-string<T> $signature
|
||||
* @param mixed $source
|
||||
* @return TObject|mixed
|
||||
* @return T|mixed
|
||||
*
|
||||
* @psalm-return (
|
||||
* $signature is class-string<TObject>
|
||||
* ? TObject
|
||||
* $signature is class-string<T>
|
||||
* ? T
|
||||
* : mixed
|
||||
* )
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user