Code Duplication    Length = 18-18 lines in 3 locations

app/controller/Article.php 2 locations

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

admin/controller/AdminArticle.php 1 location

@@ 121-138 (lines=18) @@
118
					->get();
119
			}
120
			
121
			if ((is_array($query)) && (count($query) > 0)) {
122
				$articles = [];
123
				
124
				foreach ($query as $obj) {
125
					$articles[] = [
126
						"id_article" => $obj->ID_article,
127
						"title" => $obj->title,
128
						"url" => $obj->url,
129
						"image" => $this->getImageArticle($obj->url),
130
						"article" => $obj->article,
131
						"pseudo" => $obj->pseudo,
132
						"publication_date" => $this->getDateFr($obj->publication_date),
133
						"categories" => Blog::getCategory()->getCategoryArticle($obj->url)
134
					];
135
				}
136
				
137
				Blog::setValues(["articles" => $articles]);
138
			}
139
		}
140
		//-------------------------- END GETTER ----------------------------------------------------------------------------//
141