I want to have type checking on a Ds\Map variable. In order to do this I've declared a dummy interface and declared types there:
/**
* @method OtherType offsetGet(MyType $offset)
* @method void offsetSet(MyType $offset, OtherType $value)
*/
interface MyMap extends ArrayAccess, Iterator
{
}
But when I use it:
/** @var Map|MyMap $map */
$map = new Ds\Map();
$map[$offset] = $value;
- PhpStorm doesn't recognize it and shows a warning: Illegal array key type MyType. How do I fix that?