Code Duplication    Length = 10-15 lines in 2 locations

lib/Controller/AdminController.php 1 location

@@ 139-153 (lines=15) @@
136
	 * @return DataResponse
137
	 * @throws OCSException
138
	 */
139
	public function create(
140
		string $userId,
141
		string $name,
142
		bool $personal = false,
143
		bool $local = false
144
	): DataResponse {
145
		try {
146
			$this->setLocalFederatedUser($userId);
147
			$circle = $this->circleService->create($name, null, $personal, $local);
148
149
			return new DataResponse($this->serializeArray($circle));
150
		} catch (Exception $e) {
151
			throw new OcsException($e->getMessage(), $e->getCode());
152
		}
153
	}
154
155
	/**
156
	 * @param string $userId

lib/Controller/LocalController.php 1 location

@@ 139-148 (lines=10) @@
136
	 * @return DataResponse
137
	 * @throws OCSException
138
	 */
139
	public function create(string $name, bool $personal = false, bool $local = false): DataResponse {
140
		try {
141
			$this->setCurrentFederatedUser();
142
			$circle = $this->circleService->create($name, null, $personal, $local);
143
144
			return new DataResponse($this->serializeArray($circle));
145
		} catch (Exception $e) {
146
			throw new OcsException($e->getMessage(), $e->getCode());
147
		}
148
	}
149
150
151
	/**