Code Duplication    Length = 14-14 lines in 2 locations

index.php 1 location

@@ 170-183 (lines=14) @@
167
    $article_prefix . 'blog_id',
168
    $article_prefix . 'art_time'
169
];
170
switch ($query_type) {
171
    case 'category':
172
        $articles_obj  = $articleHandler->getByCategory($criteria, $tags);
173
        $count_article = $articleHandler->getCountByCategory($criteria);
174
        break;
175
    case 'bookmark':
176
        $articles_obj  = $articleHandler->getByBookmark($criteria, $tags);
177
        $count_article = $articleHandler->getCountByBookmark($criteria);
178
        break;
179
    default:
180
        $articles_obj  = $articleHandler->getAll($criteria, $tags);
181
        $count_article = $articleHandler->getCount($criteria);
182
        break;
183
}
184
185
if (!empty($blog_data)) {
186
    $blogs[$blog_data['id']] = $blog_data['title'];

view.blogs.php 1 location

@@ 136-149 (lines=14) @@
133
$criteria->setLimit($limit);
134
135
$tags = empty($list) ? '' : [$blog_prefix . 'blog_title', $blog_prefix . 'blog_time'];
136
switch ($query_type) {
137
    case 'category':
138
        $blogs_obj  = $blogHandler->getByCategory($criteria, $tags);
139
        $count_blog = $blogHandler->getCountByCategory($criteria);
140
        break;
141
    case 'bookmark':
142
        $blogs_obj  = $blogHandler->getByBookmark($criteria, $tags);
143
        $count_blog = $blogHandler->getCountByBookmark($criteria);
144
        break;
145
    default:
146
        $blogs_obj  = $blogHandler->getAll($criteria, $tags);
147
        $count_blog = $blogHandler->getCount($criteria);
148
        break;
149
}
150
151
/* Objects to array */
152
$blogs = [];