Code Duplication    Length = 18-18 lines in 2 locations

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
	/**

lib/RemoteEvents/MemberAdd.php 1 location

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