Code Duplication    Length = 9-9 lines in 3 locations

src/Api/Broadcast.php 2 locations

@@ 25-33 (lines=9) @@
22
     *
23
     * @throws \Exception
24
     */
25
    public function create($message): BroadcastResponse
26
    {
27
        $message = $this->isValidMessage($message);
28
29
        $request = new BroadcastRequest($this->pageToken, $message);
30
        $response = $this->client->post('me/message_creatives', $request->build());
31
32
        return new BroadcastResponse($response);
33
    }
34
35
    /**
36
     * @throws \Kerox\Messenger\Exception\MessengerException
@@ 38-46 (lines=9) @@
35
    /**
36
     * @throws \Kerox\Messenger\Exception\MessengerException
37
     */
38
    public function send(string $messageCreativeId, array $options = []): BroadcastResponse
39
    {
40
        $this->isValidOptions($options);
41
42
        $request = new BroadcastRequest($this->pageToken, null, $messageCreativeId, $options);
43
        $response = $this->client->post('me/broadcast_messages', $request->build());
44
45
        return new BroadcastResponse($response);
46
    }
47
48
    /**
49
     * @throws \Kerox\Messenger\Exception\MessengerException

src/Api/Send.php 1 location

@@ 58-66 (lines=9) @@
55
    /**
56
     * @throws \Exception
57
     */
58
    public function attachment(AbstractAttachment $attachment): SendResponse
59
    {
60
        $message = $this->isValidMessage($attachment);
61
62
        $request = new SendRequest($this->pageToken, $message);
63
        $response = $this->client->post('me/message_attachments', $request->build());
64
65
        return new SendResponse($response);
66
    }
67
68
    /**
69
     * @param mixed $recipient