Code Duplication    Length = 9-9 lines in 2 locations

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

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