Thread::pass()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 7
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 7
loc 7
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 1 View Code Duplication
    public function pass(ThreadControl $threadControl): ThreadResponse
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
    {
15 1
        $request = new ThreadRequest($this->pageToken, $threadControl);
16 1
        $response = $this->client->post('me/pass_thread_control', $request->build());
17
18 1
        return new ThreadResponse($response);
19
    }
20
21 1 View Code Duplication
    public function take(ThreadControl $threadControl): ThreadResponse
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
22
    {
23 1
        $request = new ThreadRequest($this->pageToken, $threadControl);
24 1
        $response = $this->client->post('me/take_thread_control', $request->build());
25
26 1
        return new ThreadResponse($response);
27
    }
28
29 1 View Code Duplication
    public function request(ThreadControl $threadControl): ThreadResponse
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
30
    {
31 1
        $request = new ThreadRequest($this->pageToken, $threadControl);
32 1
        $response = $this->client->post('me/request_thread_control', $request->build());
33
34 1
        return new ThreadResponse($response);
35
    }
36
}
37