Code Duplication    Length = 4-7 lines in 2 locations

lib/backend/database.php 1 location

@@ 846-849 (lines=4) @@
843
844
		$one = $result->fetchOne();
845
846
		if (!$one) {
847
			\OCP\Util::writeLog('contacts', __METHOD__.', Not found, uri: '. $uri, \OCP\Util::DEBUG);
848
			return null;
849
		}
850
851
		return $one;
852
	}

lib/contact.php 1 location

@@ 602-608 (lines=7) @@
599
				if (count($property) === 0) {
600
					$property = $this->createProperty($name);
601
					$this->add($property);
602
				} elseif (count($property) > 1) {
603
					\OCP\Util::writeLog('contacts',
604
						__METHOD__.' more than one property for ' . $name,
605
						\OCP\Util::ERROR
606
					);
607
					return false;
608
				} else {
609
					// select returns an array...
610
					$property = array_shift($property);
611
				}