<?php

declare(strict_types=1);

namespace Drupal\sobki_ui_suite;

use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;

/**
 * Replace core's response_filter.active_link service with our own.
 */
class SobkiUiSuiteServiceProvider extends ServiceProviderBase {

  /**
   * {@inheritdoc}
   */
  public function alter(ContainerBuilder $container): void {
    if ($container->hasDefinition('response_filter.active_link')) {
      $definition = $container->getDefinition('response_filter.active_link');
      $definition->setClass('Drupal\sobki_ui_suite\EventSubscriber\ActiveLinkResponseFilter');
    }
  }

}
