{% import '@lib/di.twig' as di %}
<?php

declare(strict_types=1);

namespace Drupal\{{ machine_name }}\PathProcessor;

{% apply sort_namespaces %}
use Drupal\Core\PathProcessor\InboundPathProcessorInterface;
use Drupal\Core\PathProcessor\OutboundPathProcessorInterface;
use Drupal\Core\Render\BubbleableMetadata;
use Symfony\Component\HttpFoundation\Request;
  {% if services %}
{{ di.use(services) }}
  {% endif %}
{% endapply %}

/**
 * Path processor to replace 'node' with 'content' in URLs.
 *
 * @DCG In case you need to implement only one processor (inbound or outbound)
 * remove the corresponding interface, method and service tag.
 */
final class {{ class }} implements InboundPathProcessorInterface, OutboundPathProcessorInterface {
{% if services %}

  /**
   * Constructs {{ class|article }} object.
   */
  public function __construct(
{{ di.signature(services) }}
  ) {}
{% endif %}

  /**
   * {@inheritdoc}
   */
  public function processInbound($path, Request $request): string {
    return preg_replace('#^/content/#i', '/node/', $path);
  }

  /**
   * {@inheritdoc}
   */
  public function processOutbound($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL): string {
    return preg_replace('#^/node/#i', '/content/', $path);
  }

}
