| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 31 | public function channels(array $channels, callable $listener) |
||
| 32 | { |
||
| 33 | $deferred = new Deferred(); |
||
| 34 | foreach ($channels as $channel) { |
||
| 35 | $this->client->channel($channel)->subscribe( |
||
| 36 | new CallbackObserver( |
||
| 37 | $listener, |
||
| 38 | null, |
||
| 39 | function () use ($deferred) { |
||
| 40 | $deferred->resolve(); |
||
| 41 | } |
||
| 42 | ) |
||
| 43 | ); |
||
| 44 | } |
||
| 45 | await( |
||
| 46 | $deferred->promise(), |
||
| 47 | $this->loop |
||
| 48 | ); |
||
| 49 | } |
||
| 50 | } |
||
| 51 |