Code Duplication    Length = 17-17 lines in 2 locations

htdocs/class/xml/rpc/bloggerapi.php 2 locations

@@ 154-170 (lines=17) @@
151
            if (is_array($ret)) {
152
                $struct = new XoopsXmlRpcStruct();
153
                $content = '';
154
                foreach ($ret as $key => $value) {
155
                    $maptag = $this->_getXoopsTagMap($key);
156
                    switch($maptag) {
157
                    case 'userid':
158
                        $struct->add('userid', new XoopsXmlRpcString($value));
159
                        break;
160
                    case 'dateCreated':
161
                        $struct->add('dateCreated', new XoopsXmlRpcDatetime($value));
162
                        break;
163
                    case 'postid':
164
                        $struct->add('postid', new XoopsXmlRpcString($value));
165
                        break;
166
                    default :
167
                        $content .= '<'.$key.'>'.trim($value).'</'.$key.'>';
168
                        break;
169
                    }
170
                }
171
                $struct->add('content', new XoopsXmlRpcString($content));
172
                $this->response->add($struct);
173
            } else {
@@ 198-214 (lines=17) @@
195
                    for ($i = 0; $i < $count; ++$i) {
196
                        $struct = new XoopsXmlRpcStruct();
197
                        $content = '';
198
                        foreach($ret[$i] as $key => $value) {
199
                            $maptag = $this->_getXoopsTagMap($key);
200
                            switch($maptag) {
201
                            case 'userid':
202
                                $struct->add('userid', new XoopsXmlRpcString($value));
203
                                break;
204
                            case 'dateCreated':
205
                                $struct->add('dateCreated', new XoopsXmlRpcDatetime($value));
206
                                break;
207
                            case 'postid':
208
                                $struct->add('postid', new XoopsXmlRpcString($value));
209
                                break;
210
                            default :
211
                                $content .= '<'.$key.'>'.trim($value).'</'.$key.'>';
212
                                break;
213
                            }
214
                        }
215
                        $struct->add('content', new XoopsXmlRpcString($content));
216
                        $arr->add($struct);
217
                        unset($struct);