Code Duplication    Length = 6-7 lines in 3 locations

lib/Service/CirclesService.php 1 location

@@ 410-415 (lines=6) @@
407
	 */
408
	public function removeCircle($circleUniqueId, bool $force = false) {
409
410
		if ($force) {
411
			$circle = $this->circlesRequest->forceGetCircle($circleUniqueId);
412
		} else {
413
			$circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId);
414
			$this->hasToBeOwner($circle->getHigherViewer());
415
		}
416
417
418
		$this->eventsService->onCircleDestruction($circle);

lib/Service/MembersService.php 2 locations

@@ 151-157 (lines=7) @@
148
	 */
149
	public function addMember($circleUniqueId, $ident, $type, bool $force = false) {
150
151
		if ($force === true) {
152
			$circle = $this->circlesRequest->forceGetCircle($circleUniqueId);
153
		} else {
154
			$circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId);
155
			$circle->getHigherViewer()
156
				   ->hasToBeModerator();
157
		}
158
159
		if (!$this->addMassiveMembers($circle, $ident, $type)) {
160
			$this->addSingleMember($circle, $ident, $type);
@@ 643-649 (lines=7) @@
640
	 */
641
	public function removeMember($circleUniqueId, $name, $type, bool $force = false) {
642
643
		if ($force === false) {
644
			$circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId);
645
			$circle->getHigherViewer()
646
				   ->hasToBeModerator();
647
		} else {
648
			$circle = $this->circlesRequest->forceGetCircle($circleUniqueId);
649
		}
650
651
		$member = $this->membersRequest->forceGetMember($circleUniqueId, $name, $type);
652
		$member->hasToBeMemberOrAlmost();