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