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