1 | <?php |
||
10 | class SingleByteStringFunctions extends AbstractConvertor |
||
11 | { |
||
12 | /** |
||
13 | * {@inheritdoc} |
||
14 | */ |
||
15 | public function getRegexpGroups() |
||
27 | |||
28 | /** |
||
29 | * {@inheritdoc} |
||
30 | */ |
||
31 | public function getRegexps() |
||
43 | |||
44 | /** |
||
45 | * Convert a call to contains() |
||
46 | * |
||
47 | * @param string $haystack Expression for the haystack part of the call |
||
48 | * @param string $needle Expression for the needle part of the call |
||
49 | * @return string |
||
50 | */ |
||
51 | public function convertContains($haystack, $needle) |
||
55 | |||
56 | /** |
||
57 | * Convert a call to ends-with() |
||
58 | * |
||
59 | * @param string $string Expression for the string part of the call |
||
60 | * @param string $substring Expression for the substring part of the call |
||
61 | * @return string |
||
62 | */ |
||
63 | public function convertEndsWith($string, $substring) |
||
67 | |||
68 | /** |
||
69 | * Convert a call to not(contains()) |
||
70 | * |
||
71 | * @param string $haystack Expression for the haystack part of the call |
||
72 | * @param string $needle Expression for the needle part of the call |
||
73 | * @return string |
||
74 | */ |
||
75 | public function convertNotContains($haystack, $needle) |
||
79 | |||
80 | /** |
||
81 | * Convert a call to not(ends-with()) |
||
82 | * |
||
83 | * @param string $string Expression for the string part of the call |
||
84 | * @param string $substring Expression for the substring part of the call |
||
85 | * @return string |
||
86 | */ |
||
87 | public function convertNotEndsWith($string, $substring) |
||
91 | |||
92 | /** |
||
93 | * Convert a call to not(starts-with()) |
||
94 | * |
||
95 | * @param string $string Expression for the string part of the call |
||
96 | * @param string $substring Expression for the substring part of the call |
||
97 | * @return string |
||
98 | */ |
||
99 | public function convertNotStartsWith($string, $substring) |
||
103 | |||
104 | /** |
||
105 | * Convert a call to starts-with() |
||
106 | * |
||
107 | * @param string $string Expression for the string part of the call |
||
108 | * @param string $substring Expression for the substring part of the call |
||
109 | * @return string |
||
110 | */ |
||
111 | public function convertStartsWith($string, $substring) |
||
115 | |||
116 | /** |
||
117 | * Convert a call to string-length() |
||
118 | * |
||
119 | * @param string $expr |
||
120 | * @return string |
||
121 | */ |
||
122 | public function convertStringLength($expr = '.') |
||
126 | |||
127 | /** |
||
128 | * Generate the code for a call to contains() |
||
129 | * |
||
130 | * @param string $haystack Expression for the haystack part of the call |
||
131 | * @param string $needle Expression for the needle part of the call |
||
132 | * @param bool $bool Return value for a positive match |
||
133 | * @return string |
||
134 | */ |
||
135 | protected function generateContains($haystack, $needle, $bool) |
||
141 | |||
142 | /** |
||
143 | * Generate the code for a call to ends-with() |
||
144 | * |
||
145 | * @param string $string Expression for the string part of the call |
||
146 | * @param string $substring Expression for the substring part of the call |
||
147 | * @param bool $bool Return value for a positive match |
||
148 | * @return string |
||
149 | */ |
||
150 | protected function generateEndsWith($string, $substring, $bool) |
||
156 | |||
157 | /** |
||
158 | * Generate the code for a call to ends-with() where the second argument is a literal string |
||
159 | * |
||
160 | * @param string $string Expression for the string part of the call |
||
161 | * @param string $substring Expression for a literal substring |
||
162 | * @param bool $bool Return value for a positive match |
||
163 | * @return string |
||
164 | */ |
||
165 | protected function generateEndsWithLiteral($string, $substring, $bool) |
||
171 | |||
172 | /** |
||
173 | * Generate the code for a call to ends-with() |
||
174 | * |
||
175 | * @param string $string Expression for the string part of the call |
||
176 | * @param string $substring Expression for the substring part of the call |
||
177 | * @param bool $bool Return value for a positive match |
||
178 | * @return string |
||
179 | */ |
||
180 | protected function generateEndsWithExpression($string, $substring, $bool) |
||
186 | |||
187 | /** |
||
188 | * Generate the code for a call to starts-with() |
||
189 | * |
||
190 | * @param string $string Expression for the string part of the call |
||
191 | * @param string $substring Expression for the substring part of the call |
||
192 | * @param bool $bool Return value for a positive match |
||
193 | * @return string |
||
194 | */ |
||
195 | protected function generateStartsWith($string, $substring, $bool) |
||
201 | } |