mirror of
https://github.com/danog/Valinor.git
synced 2024-12-02 09:37:46 +01:00
fix: improve type definitions to allow Psalm automatic inferring
This commit is contained in:
parent
7a49f45175
commit
f9b04c5c27
@ -8,11 +8,18 @@ namespace CuyZ\Valinor\Mapper;
|
|||||||
interface TreeMapper
|
interface TreeMapper
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @template T of object
|
* @psalm-template TObject of object
|
||||||
|
* @psalm-template TypeDefinition of string|class-string<TObject>
|
||||||
*
|
*
|
||||||
* @param string|class-string<T> $signature
|
* @param TypeDefinition $signature
|
||||||
* @param mixed $source
|
* @param mixed $source
|
||||||
* @return T|mixed
|
* @return TObject|mixed
|
||||||
|
*
|
||||||
|
* @psalm-return (
|
||||||
|
* $signature is class-string<TObject>
|
||||||
|
* ? TObject
|
||||||
|
* : mixed
|
||||||
|
* )
|
||||||
*
|
*
|
||||||
* @throws MappingError
|
* @throws MappingError
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user