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

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