Code Duplication    Length = 12-13 lines in 2 locations

controller/documentcontroller.php 2 locations

@@ 166-178 (lines=13) @@
163
             'app' => $this->appName,
164
             'testgroups' => $testgroups
165
         ]);
166
         foreach ($testgroups as $testgroup) {
167
             $test = \OC::$server->getGroupManager()->get($testgroup);
168
             if ($test !== null && sizeof($test->searchUsers($user)) > 0) {
169
                 \OC::$server->getLogger()->debug('User {user} found in {group}', [
170
                     'app' => $this->appName,
171
                     'user' => $user,
172
                     'group' => $testgroup
173
                 ]);
174
175
				 $tester = true;
176
				 break;
177
             }
178
         }
179
180
         return $tester;
181
     }
@@ 484-495 (lines=12) @@
481
		$editGroups = array_filter(explode('|', $this->appConfig->getAppValue('edit_groups')));
482
		if ($updatable && count($editGroups) > 0) {
483
			$updatable = false;
484
			foreach($editGroups as $editGroup) {
485
				$editorGroup = \OC::$server->getGroupManager()->get($editGroup);
486
				if ($editorGroup !== null && sizeof($editorGroup->searchUsers($editorUid)) > 0) {
487
					\OC::$server->getLogger()->debug("Editor {editor} is in edit group {group}", [
488
						'app' => $this->appName,
489
						'editor' => $editorUid,
490
						'group' => $editGroup
491
					]);
492
					$updatable = true;
493
					break;
494
				}
495
			}
496
		}
497
498
		// If token is for some versioned file