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

Thread::getInstance()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 2
cts 2
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 2
crap 2
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