Code Duplication    Length = 5-5 lines in 2 locations

maphper/datasource/mysqladapter.php 1 location

@@ 19-23 (lines=5) @@
16
17
	private function getCachedStmt($sql) {
18
		$queryId = md5($sql);
19
		if (isset($this->queryCache[$queryId])) $stmt = $this->queryCache[$queryId];
20
		else {
21
			$stmt = $this->pdo->prepare($sql, [\PDO::ATTR_CURSOR => \PDO::CURSOR_FWDONLY]);
22
			if ($stmt) $this->queryCache[$queryId] = $stmt;
23
		}
24
		return $stmt;
25
	}
26

maphper/datasource/sqliteadapter.php 1 location

@@ 18-22 (lines=5) @@
15
		
16
	public function query(\Maphper\Lib\Query $query) {
17
		$queryId = md5($query->getSql());
18
		if (isset($this->queryCache[$queryId])) $stmt = $this->queryCache[$queryId];
19
		else {
20
			$stmt = $this->pdo->prepare($query->getSql(), [\PDO::ATTR_CURSOR => \PDO::CURSOR_FWDONLY]);
21
			if ($stmt) $this->queryCache[$queryId] = $stmt;
22
		}
23
		
24
		$args = $query->getArgs();
25
		foreach ($args as &$arg) if ($arg instanceof \DateTime) {