| @@ 56-65 (lines=10) @@ | ||
| 53 | }); |
|
| 54 | } |
|
| 55 | ||
| 56 | public function hooks(): ObservableInterface |
|
| 57 | { |
|
| 58 | return Promise::toObservable( |
|
| 59 | $this->transport->request('hooks') |
|
| 60 | )->flatMap(function ($response) { |
|
| 61 | return Observable::fromArray($response['hooks']); |
|
| 62 | })->map(function ($hook) { |
|
| 63 | return $this->transport->getHydrator()->hydrate('Hook', $hook); |
|
| 64 | }); |
|
| 65 | } |
|
| 66 | ||
| 67 | public function accounts(): ObservableInterface |
|
| 68 | { |
|
| @@ 67-76 (lines=10) @@ | ||
| 64 | }); |
|
| 65 | } |
|
| 66 | ||
| 67 | public function accounts(): ObservableInterface |
|
| 68 | { |
|
| 69 | return Promise::toObservable( |
|
| 70 | $this->transport->request('accounts') |
|
| 71 | )->flatMap(function ($response) { |
|
| 72 | return Observable::fromArray($response['accounts']); |
|
| 73 | })->map(function ($account) { |
|
| 74 | return $this->transport->getHydrator()->hydrate('Account', $account); |
|
| 75 | }); |
|
| 76 | } |
|
| 77 | ||
| 78 | public function broadcasts(): ObservableInterface |
|
| 79 | { |
|
| @@ 78-87 (lines=10) @@ | ||
| 75 | }); |
|
| 76 | } |
|
| 77 | ||
| 78 | public function broadcasts(): ObservableInterface |
|
| 79 | { |
|
| 80 | return Promise::toObservable( |
|
| 81 | $this->transport->request('broadcasts') |
|
| 82 | )->flatMap(function ($response) { |
|
| 83 | return Observable::fromArray($response['broadcasts']); |
|
| 84 | })->map(function ($broadcast) { |
|
| 85 | return $this->getTransport()->getHydrator()->hydrate('Broadcast', $broadcast); |
|
| 86 | }); |
|
| 87 | } |
|
| 88 | } |
|
| 89 | ||