Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / pathauto / src / AliasCleanerInterface.php
1 <?php
2
3 namespace Drupal\pathauto;
4
5 /**
6  * @todo add class comment.
7  */
8 interface AliasCleanerInterface {
9
10   /**
11    * Clean up an URL alias.
12    *
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.
17    *
18    * @param string $alias
19    *   A string with the URL alias to clean up.
20    *
21    * @return string
22    *   The cleaned URL alias.
23    */
24   public function cleanAlias($alias);
25
26   /**
27    * Trims duplicate, leading, and trailing separators from a string.
28    *
29    * @param string $string
30    *   The string to clean path separators from.
31    * @param string $separator
32    *   The path separator to use when cleaning.
33    *
34    * @return string
35    *   The cleaned version of the string.
36    *
37    * @see pathauto_cleanstring()
38    * @see pathauto_clean_alias()
39    */
40   public function getCleanSeparators($string, $separator = NULL);
41
42   /**
43    * Clean up a string segment to be used in an URL alias.
44    *
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.
56    *
57    * This function should *not* be called on URL alias or path strings
58    * because it is assumed that they are already clean.
59    *
60    * @param string $string
61    *   A string to clean.
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.
66    *
67    * @return string
68    *   The cleaned string.
69    */
70   public function cleanString($string, array $options = array());
71
72   /**
73    * Return an array of arrays for punctuation values.
74    *
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.
78    *
79    * @return array
80    *   An array of arrays for punctuation values keyed by a name, including the
81    *   value and a textual description.
82    */
83   public function getPunctuationCharacters();
84
85   /**
86    * Clean tokens so they are URL friendly.
87    *
88    * @param array $replacements
89    *   An array of token replacements
90    *   that need to be "cleaned" for use in the URL.
91    * @param array $data
92    *   An array of objects used to generate the replacements.
93    * @param array $options
94    *   An array of options used to generate the replacements.
95    */
96   public function cleanTokenValues(&$replacements, $data = array(), $options = array());
97
98   /**
99    * Resets internal caches.
100    */
101   public function resetCaches();
102
103 }