-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAppHandler.php
41 lines (36 loc) · 979 Bytes
/
AppHandler.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php declare(strict_types=1);
namespace ApiClients\Client\Github\CommandBus\Handler;
use ApiClients\Client\Github\CommandBus\Command\AppCommand;
use ApiClients\Client\Github\Resource\AppInterface;
use ApiClients\Tools\Services\Client\FetchAndHydrateService;
use React\Promise\PromiseInterface;
use function React\Promise\resolve;
final class AppHandler
{
/**
* @var FetchAndHydrateService
*/
private $service;
/**
* RateLimitHandler constructor.
* @param FetchAndHydrateService $service
*/
public function __construct(FetchAndHydrateService $service)
{
$this->service = $service;
}
/**
* @param AppCommand $command
* @return PromiseInterface
*/
public function handle(AppCommand $command): PromiseInterface
{
return resolve(
$this->service->fetch(
'app',
'',
AppInterface::HYDRATE_CLASS
)
);
}
}