Code Duplication    Length = 8-10 lines in 3 locations

lib/private/Collaboration/Collaborators/GroupPlugin.php 1 location

@@ 46-53 (lines=8) @@
43
	/** @var IUserSession */
44
	private $userSession;
45
46
	public function __construct(IConfig $config, IGroupManager $groupManager, IUserSession $userSession) {
47
		$this->groupManager = $groupManager;
48
		$this->config = $config;
49
		$this->userSession = $userSession;
50
51
		$this->shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes';
52
		$this->shareWithGroupOnly = $this->config->getAppValue('core', 'shareapi_only_share_with_group_members', 'no') === 'yes';
53
	}
54
55
	public function search($search, $limit, $offset, ISearchResult $searchResult) {
56
		$hasMoreResults = false;

lib/private/Collaboration/Collaborators/UserPlugin.php 1 location

@@ 51-60 (lines=10) @@
48
	/** @var IUserManager */
49
	private $userManager;
50
51
	public function __construct(IConfig $config, IUserManager $userManager, IGroupManager $groupManager, IUserSession $userSession) {
52
		$this->config = $config;
53
54
		$this->groupManager = $groupManager;
55
		$this->userSession = $userSession;
56
		$this->userManager = $userManager;
57
58
		$this->shareWithGroupOnly = $this->config->getAppValue('core', 'shareapi_only_share_with_group_members', 'no') === 'yes';
59
		$this->shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes';
60
	}
61
62
	public function search($search, $limit, $offset, ISearchResult $searchResult) {
63
		$result = ['wide' => [], 'exact' => []];

lib/private/Collaboration/Collaborators/MailPlugin.php 1 location

@@ 54-63 (lines=10) @@
51
	/** @var IUserSession */
52
	private $userSession;
53
54
	public function __construct(IManager $contactsManager, ICloudIdManager $cloudIdManager, IConfig $config, IGroupManager $groupManager, IUserSession $userSession) {
55
		$this->contactsManager = $contactsManager;
56
		$this->cloudIdManager = $cloudIdManager;
57
		$this->config = $config;
58
		$this->groupManager = $groupManager;
59
		$this->userSession = $userSession;
60
61
		$this->shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes';
62
		$this->shareWithGroupOnly = $this->config->getAppValue('core', 'shareapi_only_share_with_group_members', 'no') === 'yes';
63
	}
64
65
	/**
66
	 * @param $search