Code Duplication    Length = 10-10 lines in 3 locations

lib/Db/AssignedUsersMapper.php 1 location

@@ 91-100 (lines=10) @@
88
		return null;
89
	}
90
91
	public function mapParticipant(AssignedUsers &$assignment) {
92
		$userManager = $this->userManager;
93
		$assignment->resolveRelation('participant', function() use (&$userManager, &$assignment) {
94
			$user = $userManager->get($assignment->getParticipant());
95
			if ($user !== null) {
96
				return new User($user);
97
			}
98
			return null;
99
		});
100
	}
101
102
103
}

lib/Db/BoardMapper.php 1 location

@@ 253-262 (lines=10) @@
250
	/**
251
	 * @param Board $board
252
	 */
253
	public function mapOwner(Board &$board) {
254
		$userManager = $this->userManager;
255
		$board->resolveRelation('owner', function($owner) use (&$userManager) {
256
			$user = $userManager->get($owner);
257
			if ($user !== null) {
258
				return new User($user);
259
			}
260
			return null;
261
		});
262
	}
263
264
265
}

lib/Db/CardMapper.php 1 location

@@ 272-281 (lines=10) @@
269
		return $row['id'];
270
	}
271
272
	public function mapOwner(Card &$card) {
273
		$userManager = $this->userManager;
274
		$card->resolveRelation('owner', function($owner) use (&$userManager) {
275
			$user = $userManager->get($owner);
276
			if ($user !== null) {
277
				return new User($user);
278
			}
279
			return null;
280
		});
281
	}
282
283
284
}