Code Duplication    Length = 15-18 lines in 2 locations

PHPDaemon/Clients/Redis/Connection.php 2 locations

@@ 141-155 (lines=15) @@
138
		$this->pos = 0;
139
	}
140
141
	public function current() {
142
		if (!is_array($this->result)) {
143
			return $this->pos === 0 ? $this->result : null;
144
		}
145
		elseif ($this->resultType === static::RESULT_TYPE_DEFAULT || $this->resultType === static::RESULT_TYPE_ARGSVALS) {
146
			return $this->result[$this->pos];
147
		}
148
		elseif ($this->resultType === static::RESULT_TYPE_MESSAGE) {
149
			// message
150
			return $this->result[2];
151
		}
152
		elseif ($this->resultType === static::RESULT_TYPE_ASSOC) {
153
			return $this->result[$this->pos * 2 + 1];
154
		}
155
	}
156
157
	public function key() {
158
		if (!is_array($this->result)) {
@@ 157-174 (lines=18) @@
154
		}
155
	}
156
157
	public function key() {
158
		if (!is_array($this->result)) {
159
			return $this->pos === 0 ? 0 : null;
160
		}
161
		elseif ($this->resultType === static::RESULT_TYPE_DEFAULT) {
162
			return $this->pos;
163
		}
164
		elseif ($this->resultType === static::RESULT_TYPE_MESSAGE) {
165
			// channel
166
			return $this->result[1];
167
		}
168
		elseif ($this->resultType === static::RESULT_TYPE_ARGSVALS) {
169
			return $this->args[$this->pos];
170
		}
171
		elseif ($this->resultType === static::RESULT_TYPE_ASSOC) {
172
			return $this->result[$this->pos * 2];
173
		}
174
	}
175
176
	public function next() {
177
		++$this->pos;