Code Duplication    Length = 9-9 lines in 2 locations

src/Entities/KeyboardButton.php 1 location

@@ 70-78 (lines=9) @@
67
    /**
68
     * {@inheritdoc}
69
     */
70
    public function __call($method, $args)
71
    {
72
        // Only 1 of these can be set, so clear the others when setting a new one.
73
        if (in_array($method, ['setRequestContact', 'setRequestLocation'], true)) {
74
            unset($this->request_contact, $this->request_location);
75
        }
76
77
        return parent::__call($method, $args);
78
    }
79
}
80

src/Entities/InlineKeyboardButton.php 1 location

@@ 74-82 (lines=9) @@
71
    /**
72
     * {@inheritdoc}
73
     */
74
    public function __call($method, $args)
75
    {
76
        // Only 1 of these can be set, so clear the others when setting a new one.
77
        if (in_array($method, ['setUrl', 'setCallbackData', 'setSwitchInlineQuery'], true)) {
78
            unset($this->url, $this->callback_data, $this->switch_inline_query);
79
        }
80
81
        return parent::__call($method, $args);
82
    }
83
}
84