Code Duplication    Length = 16-24 lines in 2 locations

src/Drivers/PDO/PDODriver.php 1 location

@@ 228-243 (lines=16) @@
225
	 * @return void
226
	 * @internal
227
	 */
228
	protected function bindParams(PDOStatement &$stmt, array $values){
229
		$param_no = 1;
230
231
		foreach($values as $v){
232
233
			switch(gettype($v)){
234
				case 'boolean': $type = PDO::PARAM_BOOL; break;
235
				case 'integer': $type = PDO::PARAM_INT;  break;
236
				case 'NULL':    $type = PDO::PARAM_NULL; break;
237
				default:        $type = PDO::PARAM_STR;  break;
238
			}
239
240
			$stmt->bindValue($param_no, $v, $type);
241
			$param_no++;
242
		}
243
	}
244
245
	/**
246
	 * Returns the last insert id (if present)

src/Drivers/PDO/PDODriverAbstract.php 1 location

@@ 166-189 (lines=24) @@
163
	 *
164
	 * @return void
165
	 */
166
	protected function bindParams(PDOStatement &$stmt, array $values){
167
		$param_no = 1;
168
169
		foreach($values as $v){
170
171
			switch(gettype($v)){
172
				case 'boolean':
173
					$type = PDO::PARAM_BOOL;
174
					break;
175
				case 'integer':
176
					$type = PDO::PARAM_INT;
177
					break;
178
				case 'NULL':
179
					$type = PDO::PARAM_NULL;
180
					break;
181
				default:
182
					$type = PDO::PARAM_STR;
183
					break;
184
			}
185
186
			$stmt->bindValue($param_no, $v, $type);
187
			$param_no++;
188
		}
189
	}
190
191
	/**
192
	 * Returns the last insert id (if present)