Code Duplication    Length = 12-12 lines in 2 locations

modules/bataille/app/controller/Batiment.php 2 locations

@@ 114-125 (lines=12) @@
111
112
			$niveau = $this->getNiveauBatiment($nom_batiment, Bataille::getIdBase());
113
114
			if ($niveau > 0) {
115
				$query = $dbc1->select("production")->from("$nom_batiment")->where("ID_".$nom_batiment, "=", $niveau)->get();
116
117
				if ((is_array($query)) && (count($query) > 0)) {
118
					foreach ($query as $obj) {
119
						return $obj->production;
120
					}
121
				}
122
			}
123
			else {
124
				return 20;
125
			}
126
		}
127
128
		/**
@@ 137-148 (lines=12) @@
134
135
			$niveau = $this->getNiveauBatiment($batiment, Bataille::getIdBase());
136
137
			if ($niveau > 0) {
138
				$query = $dbc1->select("stockage")->from($batiment)->where("ID_".$batiment, "=", $niveau)->get();
139
140
				if ((is_array($query)) && (count($query) > 0)) {
141
					foreach ($query as $obj) {
142
						return $obj->stockage;
143
					}
144
				}
145
			}
146
			else {
147
				return 1000;
148
			}
149
		}
150
151
		/**