/**
  * Writes a service definition to the target module's services.yml file.
  *
  * @param TargetInterface $target
  *  The target module.
  * @param string $service_id
  *  The service ID. If an existing one with the same ID already exists,
  *  it will be overwritten.
  * @param array $service_definition
  */
 protected function writeService(TargetInterface $target, $service_id, array $service_definition)
 {
     $services = $target->getServices();
     $services->set($service_id, $service_definition);
     $this->writeInfo($target, 'services', ['services' => $services->toArray()]);
 }