Code Duplication    Length = 12-13 lines in 2 locations

app/controller/Category.php 2 locations

@@ 16-28 (lines=13) @@
13
			
14
			$query = $dbc->select()->from("_blog_category")->get();
15
			
16
			if ((is_array($query)) && (count($query) > 0)) {
17
				$categories = [];
18
				
19
				foreach ($query as $obj) {
20
					$categories[] = [
21
						"id_category" => $obj->ID_category,
22
						"category" => $obj->category,
23
						"url_category" => $obj->url_category
24
					];
25
				}
26
				
27
				Blog::setValues(["categories_list" => $categories]);
28
			}
29
		}
30
		//-------------------------- END BUILDER ----------------------------------------------------------------------------//
31
		
@@ 54-65 (lines=12) @@
51
				->where("_blog_article_category.ID_category", "=", "_blog_category.ID_category", "", true)
52
				->get();
53
			
54
			if ((is_array($query)) && (count($query) > 0)) {
55
				$categories = [];
56
				foreach ($query as $obj) {
57
					$categories[] = [
58
						"id_category" => $obj->ID_category,
59
						"category" => $obj->category,
60
						"url_category" => $obj->url_category
61
					];
62
				}
63
				
64
				return $categories;
65
			}
66
		}
67
		
68
		public function getNamemCategorieUrl() {