Skip to content

Commit

Permalink
misc: enhance TreeMapper::map() return type signature
Browse files Browse the repository at this point in the history
This signature allows auto-completion in PhpStorm when mapping to a
class, while keeping PHPStan and Psalm advanced conditional return
annotation feature.
  • Loading branch information
romm committed Dec 12, 2022
1 parent 8d0af42 commit dc32d3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Mapper/TreeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ interface TreeMapper
* @template T of object
*
* @param string|class-string<T> $signature
* @return (
* @return T
* @phpstan-return (
* $signature is class-string<T>
* ? T
* : ($signature is class-string ? object : mixed)
Expand Down

0 comments on commit dc32d3e

Please sign in to comment.