Code Duplication    Length = 31-31 lines in 2 locations

lib/Command/Index.php 1 location

@@ 562-592 (lines=31) @@
559
	 *
560
	 * @return bool|array
561
	 */
562
	private function getNavigationError($pos, $isFirst, $isLast) {
563
564
		if ($pos === 0) {
565
			if ($this->navigateLastError === true) {
566
				return end($this->errors);
567
			} else {
568
				return current($this->errors);
569
			}
570
		}
571
572
		$this->navigateLastError = false;
573
		if ($pos === -99) {
574
			return reset($this->errors);
575
		}
576
577
		if ($pos === -1 && !$isFirst) {
578
			return prev($this->errors);
579
		}
580
581
		if ($pos === 1 && !$isLast) {
582
			return next($this->errors);
583
		}
584
585
		if ($pos === 99) {
586
			$this->navigateLastError = true;
587
588
			return end($this->errors);
589
		}
590
591
		return false;
592
	}
593
594
595
	/**

lib/Command/Live.php 1 location

@@ 473-503 (lines=31) @@
470
	 *
471
	 * @return bool|array
472
	 */
473
	private function getNavigationError($pos, $isFirst, $isLast) {
474
475
		if ($pos === 0) {
476
			if ($this->navigateLastError === true) {
477
				return end($this->errors);
478
			} else {
479
				return current($this->errors);
480
			}
481
		}
482
483
		$this->navigateLastError = false;
484
		if ($pos === -99) {
485
			return reset($this->errors);
486
		}
487
488
		if ($pos === -1 && !$isFirst) {
489
			return prev($this->errors);
490
		}
491
492
		if ($pos === 1 && !$isLast) {
493
			return next($this->errors);
494
		}
495
496
		if ($pos === 99) {
497
			$this->navigateLastError = true;
498
499
			return end($this->errors);
500
		}
501
502
		return false;
503
	}
504
505
506
	/**