Code Duplication    Length = 14-14 lines in 2 locations

lib/Model/DeprecatedMember.php 2 locations

@@ 231-244 (lines=14) @@
228
	 * @throws MemberAlreadyExistsException
229
	 * @throws MemberIsBlockedException
230
	 */
231
	public function hasToBeAbleToJoinTheCircle() {
232
233
		if ($this->getLevel() > 0) {
234
			throw new MemberAlreadyExistsException(
235
				$this->l10n->t("You are already a member of this circle")
236
			);
237
		}
238
239
		if ($this->getStatus() === DeprecatedMember::STATUS_BLOCKED) {
240
			throw new MemberIsBlockedException(
241
				$this->l10n->t("You have been blocked from this circle")
242
			);
243
		}
244
	}
245
246
247
	/**
@@ 250-263 (lines=14) @@
247
	/**
248
	 * @throws MemberAlreadyExistsException
249
	 */
250
	public function hasToBeInviteAble() {
251
252
		if ($this->getLevel() > 0) {
253
			throw new MemberAlreadyExistsException(
254
				$this->l10n->t("The user is already a member of this circle")
255
			);
256
		}
257
258
		if ($this->getStatus() === DeprecatedMember::STATUS_INVITED) {
259
			throw new MemberAlreadyExistsException(
260
				$this->l10n->t("The user has already been invited into this circle")
261
			);
262
		}
263
	}
264
265
}
266