Code Duplication    Length = 6-6 lines in 2 locations

src/Entities/Chat.php 1 location

@@ 197-202 (lines=6) @@
194
    public function tryMention()
195
    {
196
        if ($this->isPrivateChat()) {
197
            if (is_null($this->username)) {
198
                if (!is_null($this->last_name)) {
199
                    return $this->first_name . ' ' . $this->last_name;
200
                }
201
                return $this->first_name;
202
            }
203
            return '@' . $this->username;
204
        }
205
        return $this->getTitle();

src/Entities/User.php 1 location

@@ 104-109 (lines=6) @@
101
     */
102
    public function tryMention()
103
    {
104
        if (is_null($this->username)) {
105
            if (!is_null($this->last_name)) {
106
                return $this->first_name . ' ' . $this->last_name;
107
            }
108
            return $this->first_name;
109
        }
110
        return '@' . $this->username;
111
    }
112
}