3 namespace Drupal\pathauto;
6 * @todo add class comment.
8 interface AliasCleanerInterface {
11 * Clean up an URL alias.
13 * Performs the following alterations:
14 * - Trim duplicate, leading, and trailing back-slashes.
15 * - Trim duplicate, leading, and trailing separators.
16 * - Shorten to a desired length and logical position based on word boundaries.
18 * @param string $alias
19 * A string with the URL alias to clean up.
22 * The cleaned URL alias.
24 public function cleanAlias($alias);
27 * Trims duplicate, leading, and trailing separators from a string.
29 * @param string $string
30 * The string to clean path separators from.
31 * @param string $separator
32 * The path separator to use when cleaning.
35 * The cleaned version of the string.
37 * @see pathauto_cleanstring()
38 * @see pathauto_clean_alias()
40 public function getCleanSeparators($string, $separator = NULL);
43 * Clean up a string segment to be used in an URL alias.
45 * Performs the following possible alterations:
46 * - Remove all HTML tags.
47 * - Process the string through the transliteration module.
48 * - Replace or remove punctuation with the separator character.
49 * - Remove back-slashes.
50 * - Replace non-ascii and non-numeric characters with the separator.
51 * - Remove common words.
52 * - Replace whitespace with the separator character.
53 * - Trim duplicate, leading, and trailing separators.
54 * - Convert to lower-case.
55 * - Shorten to a desired length and logical position based on word boundaries.
57 * This function should *not* be called on URL alias or path strings
58 * because it is assumed that they are already clean.
60 * @param string $string
62 * @param array $options
63 * (optional) A keyed array of settings and flags to control the Pathauto
64 * clean string replacement process. Supported options are:
65 * - langcode: A language code to be used when translating strings.
70 public function cleanString($string, array $options = array());
73 * Return an array of arrays for punctuation values.
75 * Returns an array of arrays for punctuation values keyed by a name,
76 * including the value and a textual description.
77 * Can and should be expanded to include "all" non text punctuation values.
80 * An array of arrays for punctuation values keyed by a name, including the
81 * value and a textual description.
83 public function getPunctuationCharacters();
86 * Clean tokens so they are URL friendly.
88 * @param array $replacements
89 * An array of token replacements
90 * that need to be "cleaned" for use in the URL.
92 * An array of objects used to generate the replacements.
93 * @param array $options
94 * An array of options used to generate the replacements.
96 public function cleanTokenValues(&$replacements, $data = array(), $options = array());
99 * Resets internal caches.
101 public function resetCaches();