public static function setPuliFactory($puliFactory)
    {
        if (!is_callable([$puliFactory, 'createRepository']) || !is_callable([$puliFactory, 'createDiscovery'])) {
            throw new \InvalidArgumentException('The Puli Factory must expose a repository and a discovery');
        }
        self::$puliFactory = $puliFactory;
        self::$puliDiscovery = null;
    }