Commit b0bb5976 authored by Bryan Sharpe's avatar Bryan Sharpe
Browse files

Issue #3314887 by b_sharpe: rot13 sub-module makes no sense, please unify with main module.

parent 3de262f7
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
name: rot13
type: module
description: 'The rot13 function for twig'
description: 'Deprecated rot13 function for twig. Will be removed in 2.1.0'
core_version_requirement: ^9 || ^10
package: Twig
lifecycle: deprecated
lifecycle_link: https://www.drupal.org/project/obfuscate_email/issues/3319019
+0 −1
Original line number Diff line number Diff line
@@ -4,5 +4,4 @@ description: 'Twig Template to obfuscate a <code>field_email</code>.'
core_version_requirement: ^9 || ^10
package: Fields
dependencies:
  - obfuscate_email:rot13
  - drupal:field
+13 −0
Original line number Diff line number Diff line
<?PHP

/**
 * @file
 * Installation file for the obfuscate email module.
 */

/**
 * Uninstalls deprecated Rot13 submodule.
 */
function obfuscate_email_update_9201(&$sandbox) {
  \Drupal::service('module_installer')->uninstall(['rot13']);
}
+6 −0
Original line number Diff line number Diff line
services:
  obfuscate_email.rot13.twig:
    arguments: ['@renderer']
    class: Drupal\obfuscate_email\Twig\Rot13Extension
    tags:
      - { name: twig.extension }
+33 −0
Original line number Diff line number Diff line
<?php

namespace Drupal\obfuscate_email\Twig;

use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;

/**
 * A class providing Drupal Twig extensions.
 *
 * Specifically Twig functions, filter and node visitors.
 *
 * @see \Drupal\Core\CoreServiceProvider
 */
class Rot13Extension extends AbstractExtension {

  /**
   * {@inheritdoc}
   */
  public function getFilters() {
    return array(
      new TwigFilter('rot13', 'str_rot13'),
    );
  }

  /**
   * {@inheritdoc}
   */
  public function getName() {
    return 'rot13_twig_extension';
  }

}