@@ 179-190 (lines=12) @@ | ||
176 | return $this->replaceWhole(\strtr($this->raw, $search, $replace)); |
|
177 | } |
|
178 | ||
179 | public function trim($mask = " \t\n\r\0\x0B", $flags = self::BOTH_ENDS) |
|
180 | { |
|
181 | // strip out bits we don't understand |
|
182 | $flags &= (self::END | self::BOTH_ENDS); |
|
183 | ||
184 | $flagsmap = [ |
|
185 | self::START => 'ltrim', |
|
186 | self::END => 'rtrim', |
|
187 | self::BOTH_ENDS => 'trim', |
|
188 | ]; |
|
189 | return $this->replaceWhole(\call_user_func($flagsmap[$flags], $this->raw, $mask)); |
|
190 | } |
|
191 | ||
192 | public function unescape($flags = self::NORMAL) |
|
193 | { |
|
@@ 192-203 (lines=12) @@ | ||
189 | return $this->replaceWhole(\call_user_func($flagsmap[$flags], $this->raw, $mask)); |
|
190 | } |
|
191 | ||
192 | public function unescape($flags = self::NORMAL) |
|
193 | { |
|
194 | // strip out bits we don't understand |
|
195 | $flags &= (self::C_STYLE | self::META); |
|
196 | ||
197 | $flagsmap = [ |
|
198 | self::NORMAL => 'stripslashes', |
|
199 | self::C_STYLE => 'stripcslashes', |
|
200 | self::META => 'stripslashes', |
|
201 | ]; |
|
202 | return $this->replaceWhole(\call_user_func($flagsmap[$flags], $this->raw)); |
|
203 | } |
|
204 | ||
205 | // TESTING METHODS |
|
206 |