Code Duplication    Length = 20-22 lines in 3 locations

lib/Controller/CirclesController.php 3 locations

@@ 97-118 (lines=22) @@
94
	 * @internal param string $name
95
	 *
96
	 */
97
	public function details($id) {
98
		try {
99
			$data = $this->circlesService->detailsCircle($id);
100
101
			return $this->success(['circle_id' => $id, 'details' => $data]);
102
		} catch (\Exception $e) {
103
104
			return $this->fail(['circle_id' => $id, 'error' => $e->getMessage()]);
105
		}
106
107
	}
108
109
110
	/**
111
	 * @NoAdminRequired
112
	 * @NoSubAdminRequired
113
	 *
114
	 * @param $id
115
	 *
116
	 * @return DataResponse
117
	 * @internal param string $name
118
	 *
119
	 */
120
	public function join($id) {
121
		try {
@@ 120-139 (lines=20) @@
117
	 * @internal param string $name
118
	 *
119
	 */
120
	public function join($id) {
121
		try {
122
			$data = $this->circlesService->joinCircle($id);
123
124
			return $this->success(['circle_id' => $id, 'member' => $data]);
125
		} catch (\Exception $e) {
126
127
			return $this->fail(['circle_id' => $id, 'error' => $e->getMessage()]);
128
		}
129
	}
130
131
132
	/**
133
	 * @NoAdminRequired
134
	 * @NoSubAdminRequired
135
	 *
136
	 * @param $id
137
	 *
138
	 * @return DataResponse
139
	 * @internal param string $name
140
	 *
141
	 */
142
	public function leave($id) {
@@ 142-161 (lines=20) @@
139
	 * @internal param string $name
140
	 *
141
	 */
142
	public function leave($id) {
143
		try {
144
			$data = $this->circlesService->leaveCircle($id);
145
146
			return $this->success(['circle_id' => $id, 'member' => $data]);
147
		} catch (\Exception $e) {
148
149
			return $this->fail(['circle_id' => $id, 'error' => $e->getMessage()]);
150
		}
151
152
	}
153
154
155
156
}
157
158