Completed
Push — master ( 3347ae...8ec7fe )
by Romain
9s
created

ThreadRequest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 47
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A buildHeaders() 0 6 1
A buildBody() 0 4 1
A buildQuery() 0 4 1
1
<?php
2
namespace Kerox\Messenger\Request;
3
4
use Kerox\Messenger\Model\ThreadSettings;
5
6
class ThreadRequest extends AbstractRequest
7
{
8
9
    /**
10
     * @var \Kerox\Messenger\Model\ThreadSettings
11
     */
12
    protected $threadSettings;
13
14
    /**
15
     * ThreadRequest constructor.
16
     *
17
     * @param string $pageToken
18
     * @param \Kerox\Messenger\Model\ThreadSettings $threadSettings
19
     */
20
    public function __construct(string $pageToken, ThreadSettings $threadSettings)
21
    {
22
        parent::__construct($pageToken);
23
24
        $this->threadSettings = $threadSettings;
25
    }
26
27
    /**
28
     * @return array
29
     */
30
    protected function buildHeaders(): array
31
    {
32
        return [
33
            'Content-Type' => 'application/json',
34
        ];
35
    }
36
37
    /**
38
     * @return ThreadSettings
39
     */
40
    protected function buildBody(): ThreadSettings
41
    {
42
        return $this->threadSettings;
43
    }
44
45
    /**
46
     * @return array
47
     */
48
    protected function buildQuery(): array
49
    {
50
        return parent::buildQuery();
51
    }
52
}
53