Passed
Push — master ( 6c011a...8a7749 )
by Romain
36s
created

Thread::pass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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 1
    public function pass(ThreadControl $threadControl): ThreadResponse
19
    {
20 1
        $request = new ThreadRequest($this->pageToken, $threadControl);
21 1
        $response = $this->client->post('me/pass_thread_control', $request->build());
22
23 1
        return new ThreadResponse($response);
24
    }
25
26
    /**
27
     * @param \Kerox\Messenger\Model\ThreadControl $threadControl
28
     *
29
     * @return \Kerox\Messenger\Response\ThreadResponse
30
     */
31 1
    public function take(ThreadControl $threadControl): ThreadResponse
32
    {
33 1
        $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
    }
38
39
    /**
40
     * @param \Kerox\Messenger\Model\ThreadControl $threadControl
41
     *
42
     * @return \Kerox\Messenger\Response\ThreadResponse
43
     */
44 1
    public function request(ThreadControl $threadControl): ThreadResponse
45
    {
46 1
        $request = new ThreadRequest($this->pageToken, $threadControl);
47 1
        $response = $this->client->post('me/request_thread_control', $request->build());
48
49 1
        return new ThreadResponse($response);
50
    }
51
}
52