Code Duplication    Length = 18-20 lines in 2 locations

lib/FederatedItems/SingleMemberAdd.php 1 location

@@ 587-606 (lines=20) @@
584
	 * @param array $links
585
	 * @param string $password
586
	 */
587
	private function memberIsMailbox(
588
		DeprecatedCircle $circle, string $recipient, array $links, string $password
589
	) {
590
		if ($circle->getViewer() === null) {
591
			$author = $circle->getOwner()
592
							 ->getUserId();
593
		} else {
594
			$author = $circle->getViewer()
595
							 ->getUserId();
596
		}
597
598
		try {
599
			$template = $this->generateMailExitingShares($author, $circle->getName());
600
			$this->fillMailExistingShares($template, $links);
601
			$this->sendMailExistingShares($template, $author, $recipient);
602
			$this->sendPasswordExistingShares($author, $recipient, $password);
603
		} catch (Exception $e) {
604
			$this->miscService->log('Failed to send mail about existing share ' . $e->getMessage());
605
		}
606
	}
607
608
609
	/**

lib/GlobalScale/MemberAdd.php 1 location

@@ 230-247 (lines=18) @@
227
	 * @param array $links
228
	 * @param string $password
229
	 */
230
	private function memberIsMailbox(DeprecatedCircle $circle, string $recipient, array $links, string $password) {
231
		if ($circle->getViewer() === null) {
232
			$author = $circle->getOwner()
233
							 ->getUserId();
234
		} else {
235
			$author = $circle->getViewer()
236
							 ->getUserId();
237
		}
238
239
		try {
240
			$template = $this->generateMailExitingShares($author, $circle->getName());
241
			$this->fillMailExistingShares($template, $links);
242
			$this->sendMailExistingShares($template, $author, $recipient);
243
			$this->sendPasswordExistingShares($author, $recipient, $password);
244
		} catch (Exception $e) {
245
			$this->miscService->log('Failed to send mail about existing share ' . $e->getMessage());
246
		}
247
	}
248
249
250
	/**