Code Duplication    Length = 15-15 lines in 2 locations

class/Link.php 2 locations

@@ 133-147 (lines=15) @@
130
    /**
131
     * @return string
132
     */
133
    public function getFromInfo()
134
    {
135
        // check if from_uid represent a user
136
137
        if ($this->getVar('from_uid')) {
138
            $user = Smartobject\Utility::getLinkedUnameFromId($this->getVar('from_uid'));
139
            if ($user == $GLOBALS['xoopsConfig']['anonymous']) {
140
                $user = '<a href="mailto:' . $this->getVar('from_email') . '">' . $this->getVar('from_email') . '</a>';
141
            }
142
        } else {
143
            $user = '<a href="mailto:' . $this->getVar('from_email') . '">' . $this->getVar('from_email') . '</a>';
144
        }
145
146
        return $user;
147
    }
148
149
    /**
150
     * @return array
@@ 165-179 (lines=15) @@
162
    /**
163
     * @return string
164
     */
165
    public function getToInfo()
166
    {
167
        // check if from_uid represent a user
168
169
        if ($this->getVar('to_uid')) {
170
            $user = Smartobject\Utility::getLinkedUnameFromId($this->getVar('to_uid'));
171
            if ($user == $GLOBALS['xoopsConfig']['anonymous']) {
172
                $user = '<a href="mailto:' . $this->getVar('to_email') . '">' . $this->getVar('to_email') . '</a>';
173
            }
174
        } else {
175
            $user = '<a href="mailto:' . $this->getVar('to_email') . '">' . $this->getVar('to_email') . '</a>';
176
        }
177
178
        return $user;
179
    }
180
}
181