forked from rugk/threema-msgapi-sdk-php
-
Notifications
You must be signed in to change notification settings - Fork 1
/
FetchPublicKey.php
53 lines (45 loc) · 1008 Bytes
/
FetchPublicKey.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
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* @author Threema GmbH
* @copyright Copyright (c) 2015-2016 Threema GmbH
*/
declare(strict_types=1);
namespace Threema\MsgApi\Commands;
use Threema\MsgApi\Response\FetchPublicKeyResponse;
class FetchPublicKey implements CommandInterface
{
/**
* @var string
*/
private $threemaId;
/**
* @param string $threemaId
*/
public function __construct(string $threemaId)
{
$this->threemaId = $threemaId;
}
/**
* @return array
*/
public function getParams(): array
{
return [];
}
/**
* @return string
*/
public function getPath(): string
{
return 'pubkeys/' . $this->threemaId;
}
/**
* @param int $httpCode
* @param string $response
* @return FetchPublicKeyResponse
*/
public function parseResult(int $httpCode, string $response): \Threema\MsgApi\Response\Response
{
return new FetchPublicKeyResponse($httpCode, $response);
}
}