Code Duplication    Length = 14-14 lines in 2 locations

lib/private/Group/Group.php 2 locations

@@ 224-237 (lines=14) @@
221
	 * @param string $search
222
	 * @return int|bool
223
	 */
224
	public function count($search = '') {
225
		$users = false;
226
		foreach ($this->backends as $backend) {
227
			if($backend->implementsActions(\OC\Group\Backend::COUNT_USERS)) {
228
				if($users === false) {
229
					//we could directly add to a bool variable, but this would
230
					//be ugly
231
					$users = 0;
232
				}
233
				$users += $backend->countUsersInGroup($this->gid, $search);
234
			}
235
		}
236
		return $users;
237
	}
238
239
	/**
240
	 * returns the number of disabled users
@@ 244-257 (lines=14) @@
241
	 *
242
	 * @return int|bool
243
	 */
244
	public function countDisabled() {
245
		$users = false;
246
		foreach ($this->backends as $backend) {
247
			if($backend->implementsActions(\OC\Group\Backend::COUNT_DISABLED)) {
248
				if($users === false) {
249
					//we could directly add to a bool variable, but this would
250
					//be ugly
251
					$users = 0;
252
				}
253
				$users += $backend->countUsersInGroup($this->gid);
254
			}
255
		}
256
		return $users;
257
	}
258
259
	/**
260
	 * search for users in the group by displayname