Total Complexity | 5 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
9 | class Create implements RequestInterface |
||
10 | { |
||
11 | const ENDPOINT = '/sobjects/%s/'; |
||
12 | |||
13 | /** |
||
14 | * @var AbstractSObjectType |
||
15 | */ |
||
16 | protected $objectType; |
||
17 | |||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $params; |
||
22 | |||
23 | 3 | public function __construct(AbstractSObjectType $objectType, array $params = []) |
|
24 | { |
||
25 | 3 | $this->objectType = $objectType; |
|
26 | 3 | $this->params = $params; |
|
27 | 3 | } |
|
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | */ |
||
32 | 1 | public function getEndpoint(): string |
|
33 | { |
||
34 | 1 | return sprintf(self::ENDPOINT, $this->objectType->value()); |
|
35 | } |
||
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | 1 | public function getMethod(): RequestMethod |
|
43 | } |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | 1 | public function getParams(): array |
|
49 | { |
||
50 | 1 | return $this->params; |
|
51 | } |
||
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | 1 | public function getContentType(): ContentType |
|
59 | } |
||
60 | } |
||
61 |