public function setURIFactory($factory)
    {
        $reflector = new \ReflectionClass($factory);
        if (!$reflector->implementsInterface('\\Erebot\\URIInterface')) {
            throw new \Erebot\InvalidValueException(
                'The factory must implement \\Erebot\\URIInterface'
            );
        }
        $this->uriFactory = $factory;
    }