Total Complexity | 4 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class IncomingRequests |
||
11 | { |
||
12 | /** |
||
13 | * @var ClientInterface |
||
14 | */ |
||
15 | private $client; |
||
16 | |||
17 | /** |
||
18 | * @var IncomingRequestsFactory |
||
19 | */ |
||
20 | private $factory; |
||
21 | |||
22 | /** |
||
23 | * IncomingRequests constructor. |
||
24 | * |
||
25 | * @param ClientInterface $client |
||
26 | * @param IncomingRequestsFactory $factory |
||
27 | */ |
||
28 | public function __construct(ClientInterface $client, IncomingRequestsFactory $factory) |
||
29 | { |
||
30 | $this->client = $client; |
||
31 | $this->factory = $factory; |
||
32 | } |
||
33 | |||
34 | public function show() |
||
35 | { |
||
36 | return $this->factory->collection( |
||
37 | $this->client->get('incoming_requests') |
||
38 | ); |
||
39 | } |
||
40 | |||
41 | public function accept($requestId) |
||
42 | { |
||
43 | return $this->factory->entity( |
||
44 | $this->client->put("incoming_requests/{$requestId}") |
||
45 | ); |
||
46 | } |
||
47 | |||
48 | public function reject($requestId): void |
||
51 | } |
||
52 | } |
||
53 |