Code Duplication    Length = 18-18 lines in 2 locations

app/controller/Article.php 2 locations

@@ 66-83 (lines=18) @@
63
				->orderBy("publication_date", "DESC")
64
				->limit(0, $nb_article)->get();
65
			
66
			if ((is_array($query)) && (count($query) > 0)) {
67
				$articles = [];
68
				
69
				foreach ($query as $obj) {
70
					$articles[] = [
71
						"id_article" => $obj->ID_article,
72
						"title" => $obj->title,
73
						"url" => $obj->url,
74
						"image" => $this->getImageArticle($obj->url),
75
						"article" => $this->getExtract($obj->article),
76
						"pseudo" => $obj->pseudo,
77
						"publication_date" => $this->getDateFr($obj->publication_date),
78
						"categories" => Blog::getCategory()->getCategoryArticle($obj->url)
79
					];
80
				}
81
				
82
				Blog::setValues(["articles" => $articles]);
83
			}
84
		}
85
		
86
		/**
@@ 141-158 (lines=18) @@
138
				->orderBy("publication_date", "DESC")
139
				->get();
140
			
141
			if ((is_array($query)) && (count($query) > 0)) {
142
				$articles = [];
143
				
144
				foreach ($query as $obj) {
145
					$articles[] = [
146
						"id_article" => $obj->ID_article,
147
						"title" => $obj->title,
148
						"url" => $obj->url,
149
						"image" => $this->getImageArticle($obj->url),
150
						"article" => $this->getExtract($obj->article),
151
						"pseudo" => $obj->pseudo,
152
						"publication_date" => $this->getDateFr($obj->publication_date),
153
						"categories" => Blog::getCategory()->getCategoryArticle($obj->url)
154
					];
155
				}
156
				
157
				Blog::setValues(["articles" => $articles]);
158
			}
159
		}
160
		//-------------------------- END GETTER ----------------------------------------------------------------------------//
161