How to implement interface that uses another interface that uses the first one, and whose child classes use the concrete classes of those interfaces

For example, there are 2 interfaces:

interface IParser {
    function toObject(string $str): IEntity;
}

interface IEntity {
    static function getParser(): IParser; 
}

And each child class implements interface methods with concrete objects of that class:

class Entity implements IEntity {
    static function getParser(): Parser {
        return new Parser();
    }
}

class Parser implements IParser {
    function toObject(string $str): Entity {
        return new Entity();
    }
}