Let's say I expose a method of my library to general usage, and I'd like to check proper usage.
/**
* @param int|string $value
*
* @return static
*/
public static function make($value): Enumerable
{
if (! is_int($value) && ! is_string($value)) {
throw new TypeError(static::class.'::make() expects string|int as argument but '.gettype($value).' given');
}
PHPStan will tell me Result of && is always false.
What do you suggest?