public function set(string $key, $value)
    {
        $config = $this->repository->findOneBy(['key' => $key]);

        if (!$config) {
            throw new OutOfRangeException('Config "'.$key.'" does not exist.');
        }

        $config
            ->setKey($key)
            ->setValue($value);
        $this->manager->persist($config);
        $this->manager->flush();
        $this->manager->detach($config);
    }