Completed
Push — master ( 79dd3c...f666f7 )
by
unknown
10s
created

Delete::getContentType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Xsolve\SalesforceClient\Request;
4
5
use Xsolve\SalesforceClient\Enum\AbstractSObjectType;
6
use Xsolve\SalesforceClient\Enum\ContentType;
7
use Xsolve\SalesforceClient\Enum\RequestMethod;
8
9 View Code Duplication
class Delete implements RequestInterface
10
{
11
    const ENDPOINT = '/sobjects/%s/%s/';
12
13
    /**
14
     * @var AbstractSObjectType
15
     */
16
    protected $objectType;
17
18
    /**
19
     * @var string
20
     */
21
    protected $id;
22
23 2
    public function __construct(AbstractSObjectType $objectType, string $id)
24
    {
25 2
        $this->objectType = $objectType;
26 2
        $this->id = $id;
27 2
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32 1
    public function getMethod(): RequestMethod
33
    {
34 1
        return RequestMethod::DELETE();
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40 1
    public function getEndpoint(): string
41
    {
42 1
        return sprintf(self::ENDPOINT, $this->objectType->value(), $this->id);
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48 1
    public function getParams(): array
49
    {
50 1
        return [];
51
    }
52
53 1
    public function getContentType(): ContentType
54
    {
55 1
        return ContentType::FORM();
56
    }
57
}
58