Code Duplication    Length = 32-39 lines in 5 locations

src/Api/Request/Account/VerifyCredentials.php 1 location

@@ 7-38 (lines=32) @@
4
5
use PeeHaa\AsyncTwitter\Api\Request\BaseRequest;
6
7
class VerifyCredentials extends BaseRequest
8
{
9
    const METHOD   = 'GET';
10
11
    const ENDPOINT = '/account/verify_credentials.json';
12
13
    public function __construct()
14
    {
15
        parent::__construct(self::METHOD, self::ENDPOINT);
16
    }
17
18
    public function excludeEntities(): VerifyCredentials
19
    {
20
        $this->parameters['include_entities'] = 'false';
21
22
        return $this;
23
    }
24
25
    public function skipStatus(): VerifyCredentials
26
    {
27
        $this->parameters['skip_status'] = 'true';
28
29
        return $this;
30
    }
31
32
    public function includeEmail(): VerifyCredentials
33
    {
34
        $this->parameters['include_email'] = 'true';
35
36
        return $this;
37
    }
38
}
39

src/Api/Request/Block/Collection.php 1 location

@@ 7-38 (lines=32) @@
4
5
use PeeHaa\AsyncTwitter\Api\Request\BaseRequest;
6
7
class Collection extends BaseRequest
8
{
9
    const METHOD   = 'GET';
10
11
    const ENDPOINT = '/blocks/list.json';
12
13
    public function __construct()
14
    {
15
        parent::__construct(self::METHOD, self::ENDPOINT);
16
    }
17
18
    public function excludeEntities(): Collection
19
    {
20
        $this->parameters['include_entities'] = 'false';
21
22
        return $this;
23
    }
24
25
    public function skipStatus(): Collection
26
    {
27
        $this->parameters['skip_status'] = 'true';
28
29
        return $this;
30
    }
31
32
    public function fromCursor(int $cursor): Collection
33
    {
34
        $this->parameters['cursor'] = (string) $cursor;
35
36
        return $this;
37
    }
38
}
39

src/Api/Request/Status/Show.php 1 location

@@ 7-39 (lines=33) @@
4
5
use PeeHaa\AsyncTwitter\Api\Request\BaseRequest;
6
7
class Show extends BaseRequest
8
{
9
    const METHOD   = 'GET';
10
    const ENDPOINT = '/statuses/show.json';
11
12
    public function __construct(int $id)
13
    {
14
        parent::__construct(self::METHOD, self::ENDPOINT);
15
16
        $this->parameters['id'] = (string) $id;
17
    }
18
19
    public function trimUser(): Show
20
    {
21
        $this->parameters['trim_user'] = 'true';
22
23
        return $this;
24
    }
25
26
    public function excludeEntities(): Show
27
    {
28
        $this->parameters['include_entities'] = 'false';
29
30
        return $this;
31
    }
32
33
    public function includeUserRetweetStatus(): Show
34
    {
35
        $this->parameters['include_my_retweet'] = 'true';
36
37
        return $this;
38
    }
39
}
40

src/Api/Request/Collection/Lists.php 1 location

@@ 7-38 (lines=32) @@
4
5
use PeeHaa\AsyncTwitter\Api\Request\BaseRequest;
6
7
abstract class Lists extends BaseRequest
8
{
9
    const METHOD   = 'GET';
10
11
    const ENDPOINT = '/collections/list.json';
12
13
    public function __construct()
14
    {
15
        parent::__construct(self::METHOD, self::ENDPOINT);
16
    }
17
18
    public function amount(int $amount): Lists
19
    {
20
        $this->parameters['count'] = (string) $amount;
21
22
        return $this;
23
    }
24
25
    public function tweetId(int $tweetId): Lists
26
    {
27
        $this->parameters['tweet_id'] = (string) $tweetId;
28
29
        return $this;
30
    }
31
32
    public function fromCursor(string $cursor): Lists
33
    {
34
        $this->parameters['cursor'] = $cursor;
35
36
        return $this;
37
    }
38
}
39

src/Api/Request/Lists/Member.php 1 location

@@ 10-48 (lines=39) @@
7
/**
8
 * @link https://dev.twitter.com/rest/reference/get/lists/members
9
 */
10
abstract class Member extends BaseRequest
11
{
12
    const METHOD   = 'GET';
13
14
    const ENDPOINT = '/lists/members.json';
15
16
    public function __construct()
17
    {
18
        parent::__construct(self::METHOD, self::ENDPOINT);
19
    }
20
21
    public function amount(int $amount): Member
22
    {
23
        $this->parameters['count'] = (string) $amount;
24
25
        return $this;
26
    }
27
28
    public function fromCursor(int $cursor): Member
29
    {
30
        $this->parameters['cursor'] = (string) $cursor;
31
32
        return $this;
33
    }
34
35
    public function excludeEntities(): Member
36
    {
37
        $this->parameters['include_entities'] = 'false';
38
39
        return $this;
40
    }
41
42
    public function skipStatus(): Member
43
    {
44
        $this->parameters['skip_status'] = 'true';
45
46
        return $this;
47
    }
48
}
49