| @@ 325-335 (lines=11) @@ | ||
| 322 | public function __call($cmd, $args) |
|
| 323 | { |
|
| 324 | $cb = null; |
|
| 325 | for ($i = sizeof($args) - 1; $i >= 0; --$i) { |
|
| 326 | $a = $args[$i]; |
|
| 327 | if ((is_array($a) || is_object($a)) && is_callable($a)) { |
|
| 328 | $cb = CallbackWrapper::wrap($a); |
|
| 329 | $args = array_slice($args, 0, $i); |
|
| 330 | break; |
|
| 331 | } elseif ($a !== null) { |
|
| 332 | break; |
|
| 333 | } |
|
| 334 | } |
|
| 335 | $cmd = strtoupper($cmd); |
|
| 336 | $this->command($cmd, $args, $cb); |
|
| 337 | } |
|
| 338 | ||
| @@ 361-372 (lines=12) @@ | ||
| 358 | } |
|
| 359 | ||
| 360 | $opcb = null; |
|
| 361 | for ($i = sizeof($args) - 1; $i >= 0; --$i) { |
|
| 362 | $a = $args[$i]; |
|
| 363 | if ((is_array($a) || is_object($a)) && is_callable($a)) { |
|
| 364 | $opcb = $cb; |
|
| 365 | $cb = CallbackWrapper::wrap($a); |
|
| 366 | $args = array_slice($args, 0, $i); |
|
| 367 | break; |
|
| 368 | } elseif ($a !== null) { |
|
| 369 | break; |
|
| 370 | } |
|
| 371 | } |
|
| 372 | } |
|
| 373 | ||
| 374 | if ($name === 'SUBSCRIBE') { |
|
| 375 | $this->subscribed(); |
|
| @@ 80-90 (lines=11) @@ | ||
| 77 | public function __call($cmd, $args) |
|
| 78 | { |
|
| 79 | $cb = null; |
|
| 80 | for ($i = sizeof($args) - 1; $i >= 0; --$i) { |
|
| 81 | $a = $args[$i]; |
|
| 82 | if ((is_array($a) || is_object($a)) && is_callable($a)) { |
|
| 83 | $cb = CallbackWrapper::wrap($a); |
|
| 84 | $args = array_slice($args, 0, $i); |
|
| 85 | break; |
|
| 86 | } elseif ($a !== null) { |
|
| 87 | break; |
|
| 88 | } |
|
| 89 | } |
|
| 90 | reset($args); |
|
| 91 | $cmd = strtoupper($cmd); |
|
| 92 | ||
| 93 | if ($this->sendSubCommand($cmd, $args, $cb)) { |
|