1 | <?php |
||
10 | class SingleByteStringManipulation extends AbstractConvertor |
||
11 | { |
||
12 | /** |
||
13 | * {@inheritdoc} |
||
14 | */ |
||
15 | public function getRegexpGroups() |
||
25 | |||
26 | /** |
||
27 | * {@inheritdoc} |
||
28 | */ |
||
29 | public function getRegexps() |
||
39 | |||
40 | /** |
||
41 | * Convert a call to concat() |
||
42 | * |
||
43 | * @param string $expr1 First argument |
||
44 | * @param string $expr2 All other comma-separated arguments, starting with a comma |
||
45 | * @return string |
||
46 | */ |
||
47 | public function convertConcat($expr1, $expr2 = null) |
||
57 | |||
58 | /** |
||
59 | * Convert a call to normalize-space() |
||
60 | * |
||
61 | * @param string $expr |
||
62 | * @return string |
||
63 | */ |
||
64 | public function convertNormalizeSpace($expr) |
||
68 | |||
69 | /** |
||
70 | * Convert a call to substring-after() where the second argument is a literal string |
||
71 | * |
||
72 | * @param string $expr |
||
73 | * @param string $str |
||
74 | * @return string |
||
75 | */ |
||
76 | public function convertSubstringAfter($expr, $str) |
||
80 | |||
81 | /** |
||
82 | * Convert a call to substring-before() |
||
83 | * |
||
84 | * @param string $expr1 |
||
85 | * @param string $expr2 |
||
86 | * @return string |
||
87 | */ |
||
88 | public function convertSubstringBefore($expr1, $expr2) |
||
92 | |||
93 | /** |
||
94 | * Convert a call to translate() where the second and third arguments are literal strings |
||
95 | * |
||
96 | * @param string $expr |
||
97 | * @param string $from |
||
98 | * @param string $to |
||
99 | * @return string |
||
100 | */ |
||
101 | public function convertTranslate($expr, $from, $to) |
||
125 | |||
126 | /** |
||
127 | * Test whether given list of strings contains only single ASCII characters |
||
128 | * |
||
129 | * @param string[] $chars |
||
130 | * @return bool |
||
131 | */ |
||
132 | protected function isAsciiChars(array $chars) |
||
136 | |||
137 | /** |
||
138 | * Serialize a list of ASCII chars into a single PHP string |
||
139 | * |
||
140 | * @param string[] $chars |
||
141 | * @return string |
||
142 | */ |
||
143 | protected function serializeAsciiChars(array $chars) |
||
147 | |||
148 | /** |
||
149 | * Serialize the lists of characters to replace with strtr() |
||
150 | * |
||
151 | * @param string[] $from |
||
152 | * @param string[] $to |
||
153 | * @return string |
||
154 | */ |
||
155 | protected function serializeMap(array $from, array $to) |
||
165 | |||
166 | /** |
||
167 | * Split individual characters from given literal string |
||
168 | * |
||
169 | * @param string $string Original string, including quotes |
||
170 | * @return string[] |
||
171 | */ |
||
172 | protected function splitStringChars($string) |
||
178 | } |