Code Duplication    Length = 5-6 lines in 2 locations

lib/contact.php 2 locations

@@ 484-489 (lines=6) @@
481
	public function getPropertyIndexByChecksum($checksum) {
482
		$this->retrieve();
483
		$idx = 0;
484
		foreach ($this->children as $i => &$property) {
485
			if (substr(md5($property->serialize()), 0, 8) == $checksum ) {
486
				return $idx;
487
			}
488
			$idx += 1;
489
		}
490
		throw new Exception(self::$l10n->t('Property not found'), 404);
491
	}
492
@@ 502-506 (lines=5) @@
499
	*/
500
	public function getPropertyByChecksum($checksum) {
501
		$this->retrieve();
502
		foreach ($this->children as $i => &$property) {
503
			if (substr(md5($property->serialize()), 0, 8) == $checksum ) {
504
				return $property;
505
			}
506
		}
507
		throw new Exception(self::$l10n->t('Property not found'), 404);
508
	}
509