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

@@ 613-619 (lines=7) @@
610
				if (count($property) === 0) {
611
					$property = $this->createProperty($name);
612
					$this->add($property);
613
				} elseif (count($property) > 1) {
614
					\OCP\Util::writeLog('contacts',
615
						__METHOD__.' more than one property for ' . $name,
616
						\OCP\Util::ERROR
617
					);
618
					return false;
619
				} else {
620
					// select returns an array...
621
					$property = array_shift($property);
622
				}