| @@ 42-51 (lines=10) @@ | ||
| 39 | }); |
|
| 40 | } |
|
| 41 | ||
| 42 | public function hooks(): ObservableInterface |
|
| 43 | { |
|
| 44 | return Promise::toObservable( |
|
| 45 | $this->transport->request('hooks') |
|
| 46 | )->flatMap(function ($response) { |
|
| 47 | return Observable::fromArray($response['hooks']); |
|
| 48 | })->map(function ($hook) { |
|
| 49 | return $this->transport->getHydrator()->hydrate('Hook', $hook); |
|
| 50 | }); |
|
| 51 | } |
|
| 52 | ||
| 53 | public function accounts(): ObservableInterface |
|
| 54 | { |
|
| @@ 53-62 (lines=10) @@ | ||
| 50 | }); |
|
| 51 | } |
|
| 52 | ||
| 53 | public function accounts(): ObservableInterface |
|
| 54 | { |
|
| 55 | return Promise::toObservable( |
|
| 56 | $this->transport->request('accounts') |
|
| 57 | )->flatMap(function ($response) { |
|
| 58 | return Observable::fromArray($response['accounts']); |
|
| 59 | })->map(function ($account) { |
|
| 60 | return $this->transport->getHydrator()->hydrate('Account', $account); |
|
| 61 | }); |
|
| 62 | } |
|
| 63 | ||
| 64 | public function broadcasts(): ObservableInterface |
|
| 65 | { |
|
| @@ 64-73 (lines=10) @@ | ||
| 61 | }); |
|
| 62 | } |
|
| 63 | ||
| 64 | public function broadcasts(): ObservableInterface |
|
| 65 | { |
|
| 66 | return Promise::toObservable( |
|
| 67 | $this->transport->request('broadcasts') |
|
| 68 | )->flatMap(function ($response) { |
|
| 69 | return Observable::fromArray($response['broadcasts']); |
|
| 70 | })->map(function ($broadcast) { |
|
| 71 | return $this->getTransport()->getHydrator()->hydrate('Broadcast', $broadcast); |
|
| 72 | }); |
|
| 73 | } |
|
| 74 | } |
|
| 75 | ||