Code Duplication    Length = 9-10 lines in 2 locations

lib/ar/connect/db.php 2 locations

@@ 47-55 (lines=9) @@
44
		return $this->cursor;
45
	}
46
47
	public function next() {
48
		if ($this->wrapped instanceof PDOStatement) {
49
			$this->row = $this->wrapped->fetch();
50
		}
51
		if (!$this->row) {
52
			$this->row = null;
53
		}
54
		$this->cursor++;
55
	}
56
57
	public function rewind() {
58
		if ($this->wrapped instanceof PDOStatement) {
@@ 57-66 (lines=10) @@
54
		$this->cursor++;
55
	}
56
57
	public function rewind() {
58
		if ($this->wrapped instanceof PDOStatement) {
59
			$this->wrapped->execute();
60
			$this->row = $this->wrapped->fetch();
61
		}
62
		if (!$this->row) {
63
			$this->row = null;
64
		}
65
		$this->cursor = 0;
66
	}
67
68
	public function valid() {
69
		// note: somehow isset() returns false here, so use is_array instead.