Code Duplication    Length = 9-9 lines in 2 locations

lib/private/Lock/Persistent/LockMapper.php 2 locations

@@ 114-122 (lines=9) @@
111
		return $this->findEntity($query->getSQL(), $query->getParameters());
112
	}
113
114
	public function insert(Entity $entity) {
115
		if (!$entity instanceof Lock) {
116
			throw new \InvalidArgumentException('Wrong entity type used');
117
		}
118
		if (\md5($entity->getToken()) !== $entity->getTokenHash()) {
119
			throw new \InvalidArgumentException('token_hash does not match the token of the lock');
120
		}
121
		return parent::insert($entity);
122
	}
123
124
	public function update(Entity $entity) {
125
		if (!$entity instanceof Lock) {
@@ 124-132 (lines=9) @@
121
		return parent::insert($entity);
122
	}
123
124
	public function update(Entity $entity) {
125
		if (!$entity instanceof Lock) {
126
			throw new \InvalidArgumentException('Wrong entity type used');
127
		}
128
		if (\md5($entity->getToken()) !== $entity->getTokenHash()) {
129
			throw new \InvalidArgumentException('token_hash does not match the token of the lock');
130
		}
131
		return parent::update($entity);
132
	}
133
134
	public function cleanup() {
135
		$query = $this->db->getQueryBuilder();