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