Passed
Pull Request — master (#91)
by Romain
02:54
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
rs 10
c 0
b 0
f 0
ccs 6
cts 6
cp 1

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 GuzzleHttp\ClientInterface;
8
use Kerox\Messenger\Model\ThreadControl;
9
use Kerox\Messenger\Request\ThreadRequest;
10
use Kerox\Messenger\Response\ThreadResponse;
11
12
class Thread extends AbstractApi
13
{
14
    /**
15
     * @param \Kerox\Messenger\Model\ThreadControl $threadControl
16
     *
17
     * @return \Kerox\Messenger\Response\ThreadResponse
18
     */
19
    public function pass(ThreadControl $threadControl): ThreadResponse
20
    {
21
        $request = new ThreadRequest($this->pageToken, $threadControl);
22
        $response = $this->client->post('me/pass_thread_control', $request->build());
23 3
24
        return new ThreadResponse($response);
25 3
    }
26 3
27
    /**
28
     * @param \Kerox\Messenger\Model\ThreadControl $threadControl
29
     *
30
     * @return \Kerox\Messenger\Response\ThreadResponse
31
     */
32
    public function take(ThreadControl $threadControl): ThreadResponse
33
    {
34 1
        $request = new ThreadRequest($this->pageToken, $threadControl);
35
        $response = $this->client->post('me/take_thread_control', $request->build());
36 1
37 1
        return new ThreadResponse($response);
38
    }
39
}
40