@@ 265-279 (lines=15) @@ | ||
262 | * @param $str |
|
263 | * @return mixed |
|
264 | */ |
|
265 | public function format($str) |
|
266 | { |
|
267 | if (! is_array($this->formatters)) return $str; |
|
268 | ||
269 | foreach ($this->formatters as $formatter) { |
|
270 | $method = $formatter['callable']; |
|
271 | $cascade = $formatter['cascade']; |
|
272 | ||
273 | $str = call_user_func($method, $str); |
|
274 | ||
275 | if (! $cascade) return $str; |
|
276 | } |
|
277 | ||
278 | return $str; |
|
279 | } |
|
280 | ||
281 | //-------------------------------------------------------------------- |
|
282 |
@@ 257-271 (lines=15) @@ | ||
254 | * @param $str |
|
255 | * @return mixed |
|
256 | */ |
|
257 | public function format($str) |
|
258 | { |
|
259 | if (! is_array($this->formatters)) return $str; |
|
260 | ||
261 | foreach ($this->formatters as $formatter) { |
|
262 | $method = key($formatter); |
|
263 | $cascade = $formatter[$method]; |
|
264 | ||
265 | $str = call_user_func($method, $str); |
|
266 | ||
267 | if (! $cascade) return $str; |
|
268 | } |
|
269 | ||
270 | return $str; |
|
271 | } |
|
272 | ||
273 | //-------------------------------------------------------------------- |
|
274 |