Code Duplication    Length = 26-26 lines in 2 locations

lib/stores/modules/sql_compiler.php 2 locations

@@ 247-272 (lines=26) @@
244
		return $result;
245
	}
246
247
	protected function parse_and_expr(&$YYBUFFER) {
248
		$result=$this->parse_group_expr($YYBUFFER);
249
		while (is_array($result)) {
250
			$YYCURSOR = 0;
251
			while (isset($this->_SCAN_WS[$YYBUFFER[$YYCURSOR]])) {
252
				$YYCURSOR++;
253
			}
254
			$ident = strtolower(substr($YYBUFFER, $YYCURSOR, 3));
255
			if ($ident === 'and' && !isset($this->_SCAN_AZ_09[$YYBUFFER[$YYCURSOR + 3]]) ) {
256
				$YYBUFFER = substr($YYBUFFER, $YYCURSOR + 3);
257
				$right = $this->parse_group_expr($YYBUFFER);
258
				if (is_array($right)) {
259
					$result = array(
260
						'id' => $ident,
261
						'left' => $result,
262
						'right' => $right
263
					);
264
				} else {
265
					unset($result);
266
				}
267
			} else {
268
				break;
269
			}
270
		}
271
		return $result;
272
	}
273
274
	protected function parse_or_expr(&$YYBUFFER) {
275
		$result=$this->parse_and_expr($YYBUFFER);
@@ 274-299 (lines=26) @@
271
		return $result;
272
	}
273
274
	protected function parse_or_expr(&$YYBUFFER) {
275
		$result=$this->parse_and_expr($YYBUFFER);
276
		while (is_array($result)) {
277
			$YYCURSOR = 0;
278
			while (isset($this->_SCAN_WS[$YYBUFFER[$YYCURSOR]])) {
279
				$YYCURSOR++;
280
			}
281
			$ident = strtolower(substr($YYBUFFER, $YYCURSOR, 2));
282
			if ($ident === 'or' && !isset($this->_SCAN_AZ_09[$YYBUFFER[$YYCURSOR + 2]]) ) {
283
				$YYBUFFER = substr($YYBUFFER, $YYCURSOR + 2);
284
				$right = $this->parse_and_expr($YYBUFFER);
285
				if (is_array($right)) {
286
					$result = array(
287
						'id' => $ident,
288
						'left' => $result,
289
						'right' => $right
290
					);
291
				} else {
292
					unset($result);
293
				}
294
			} else {
295
				break;
296
			}
297
		}
298
		return $result;
299
	}
300
301
	protected function parse_orderby(&$YYBUFFER) {
302
		$field = $this->parse_ident($YYBUFFER);