@param-assert UnionType $paramName or @x-assert UnionType $paramName are my best ideas so far.
Phan has @phan-assert, Psalm has @psalm-assert, PHPStan has an open issue, and I haven't checked to see if any similar tags exist elsewhere.
Psalm also has @psalm-assert-if-true and @psalm-assert-if-false - https://github.com/vimeo/psalm/blob/master/docs/annotating_code/adding_assertions.md
- Possibly document implemented extensions such as
truthy that aren't union types
- Tool authors may wish to emit warnings if non-union types such as
truthy are used in the common tag instead of the tool-specific phpdoc annotations
- Having a common annotation will make it much easier for IDEs and other tools to make use of annotations in libraries in the future (e.g. webmozart/assert)
Related to phpstan/phpstan#2223
cc @ondrejmirtes @muglug @staabm