Completed
Push — master ( 393226...f49a8d )
by Romain
11s
created

Thread   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 39
rs 10
c 0
b 0
f 0
ccs 8
cts 8
cp 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A take() 0 6 1
A pass() 0 6 1
A request() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Kerox\Messenger\Api;
6
7
use Kerox\Messenger\Model\ThreadControl;
8
use Kerox\Messenger\Request\ThreadRequest;
9
use Kerox\Messenger\Response\ThreadResponse;
10
11
class Thread extends AbstractApi
12
{
13
    /**
14
     * @param \Kerox\Messenger\Model\ThreadControl $threadControl
15
     *
16
     * @return \Kerox\Messenger\Response\ThreadResponse
17
     */
18
    public function pass(ThreadControl $threadControl): ThreadResponse
19
    {
20
        $request = new ThreadRequest($this->pageToken, $threadControl);
21
        $response = $this->client->post('me/pass_thread_control', $request->build());
22
23 3
        return new ThreadResponse($response);
24
    }
25 3
26 3
    /**
27
     * @param \Kerox\Messenger\Model\ThreadControl $threadControl
28
     *
29
     * @return \Kerox\Messenger\Response\ThreadResponse
30
     */
31
    public function take(ThreadControl $threadControl): ThreadResponse
32
    {
33
        $request = new ThreadRequest($this->pageToken, $threadControl);
34 1
        $response = $this->client->post('me/take_thread_control', $request->build());
35
36 1
        return new ThreadResponse($response);
37 1
    }
38
39
    /**
40 1
     * @param \Kerox\Messenger\Model\ThreadControl $threadControl
41
     *
42
     * @return \Kerox\Messenger\Response\ThreadResponse
43
     */
44
    public function request(ThreadControl $threadControl): ThreadResponse
45
    {
46
        $request = new ThreadRequest($this->pageToken, $threadControl);
47
        $response = $this->client->post('me/request_thread_control', $request->build());
48 1
49
        return new ThreadResponse($response);
50 1
    }
51
}
52