From dc32d3e1d5b26ea175a01c88eba14549afc53abe Mon Sep 17 00:00:00 2001 From: Romain Canon Date: Mon, 12 Dec 2022 23:09:29 +0100 Subject: [PATCH] misc: enhance `TreeMapper::map()` return type signature This signature allows auto-completion in PhpStorm when mapping to a class, while keeping PHPStan and Psalm advanced conditional return annotation feature. --- src/Mapper/TreeMapper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Mapper/TreeMapper.php b/src/Mapper/TreeMapper.php index b386dde1..8da44254 100644 --- a/src/Mapper/TreeMapper.php +++ b/src/Mapper/TreeMapper.php @@ -13,7 +13,8 @@ interface TreeMapper * @template T of object * * @param string|class-string $signature - * @return ( + * @return T + * @phpstan-return ( * $signature is class-string * ? T * : ($signature is class-string ? object : mixed)