code: 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);
      }
docs: Set config value
  
  @param string $key
  @param mixed $value