Code Duplication    Length = 46-46 lines in 4 locations

src/Api/Request/DirectMessage/DirectMessages.php 1 location

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

src/Api/Request/DirectMessage/Sent.php 1 location

@@ 10-55 (lines=46) @@
7
/**
8
 * @link https://dev.twitter.com/rest/reference/get/direct_messages/sent
9
 */
10
class Sent extends BaseRequest
11
{
12
    const METHOD   = 'GET';
13
14
    const ENDPOINT = '/direct_messages/sent.json';
15
16
    public function __construct()
17
    {
18
        parent::__construct(self::METHOD, self::ENDPOINT);
19
    }
20
21
    public function minimumId(int $id): Sent
22
    {
23
        $this->parameters['since_id'] = (string) $id;
24
25
        return $this;
26
    }
27
28
    public function maximumId(int $id): Sent
29
    {
30
        $this->parameters['max_id'] = (string) $id;
31
32
        return $this;
33
    }
34
35
    public function amount(int $amount): Sent
36
    {
37
        $this->parameters['count'] = (string) $amount;
38
39
        return $this;
40
    }
41
42
    public function page(int $page): Sent
43
    {
44
        $this->parameters['page'] = (string) $page;
45
46
        return $this;
47
    }
48
49
    public function excludeEntities(): Sent
50
    {
51
        $this->parameters['include_entities'] = 'false';
52
53
        return $this;
54
    }
55
}
56

src/Api/Request/Follower/Ids.php 1 location

@@ 10-55 (lines=46) @@
7
/**
8
 * @link https://dev.twitter.com/rest/reference/get/followers/ids
9
 */
10
class Ids extends BaseRequest
11
{
12
    const METHOD   = 'GET';
13
14
    const ENDPOINT = '/followers/ids.json';
15
16
    public function __construct()
17
    {
18
        parent::__construct(self::METHOD, self::ENDPOINT);
19
    }
20
21
    public function userId(int $id): Ids
22
    {
23
        $this->parameters['user_id'] = (string) $id;
24
25
        return $this;
26
    }
27
28
    public function screenName(string $screenName): Ids
29
    {
30
        $this->parameters['screen_name'] = $screenName;
31
32
        return $this;
33
    }
34
35
    public function fromCursor(int $cursor): Ids
36
    {
37
        $this->parameters['cursor'] = (string) $cursor;
38
39
        return $this;
40
    }
41
42
    public function stringifyIds(): Ids
43
    {
44
        $this->parameters['stringify_ids'] = 'true';
45
46
        return $this;
47
    }
48
49
    public function amount(int $amount): Ids
50
    {
51
        $this->parameters['count'] = (string) $amount;
52
53
        return $this;
54
    }
55
}
56

src/Api/Request/Friend/Ids.php 1 location

@@ 10-55 (lines=46) @@
7
/**
8
 * @link https://dev.twitter.com/rest/reference/get/friends/ids
9
 */
10
class Ids extends BaseRequest
11
{
12
    const METHOD   = 'GET';
13
14
    const ENDPOINT = '/friends/ids.json';
15
16
    public function __construct()
17
    {
18
        parent::__construct(self::METHOD, self::ENDPOINT);
19
    }
20
21
    public function userId(int $id): Ids
22
    {
23
        $this->parameters['user_id'] = (string) $id;
24
25
        return $this;
26
    }
27
28
    public function screenName(string $screenName): Ids
29
    {
30
        $this->parameters['screen_name'] = $screenName;
31
32
        return $this;
33
    }
34
35
    public function fromCursor(int $cursor): Ids
36
    {
37
        $this->parameters['cursor'] = (string) $cursor;
38
39
        return $this;
40
    }
41
42
    public function stringifyIds(): Ids
43
    {
44
        $this->parameters['stringify_ids'] = 'true';
45
46
        return $this;
47
    }
48
49
    public function amount(int $amount): Ids
50
    {
51
        $this->parameters['count'] = (string) $amount;
52
53
        return $this;
54
    }
55
}
56