Completed
Push — master ( 4c1222...393226 )
by Romain
10s
created

Thread   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 26
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A take() 0 6 1
A pass() 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