Code Duplication    Length = 21-21 lines in 2 locations

src/installer/ModuleInstaller.php 1 location

@@ 154-174 (lines=21) @@
151
	 * @param string $name
152
	 * @return Group
153
	 */
154
	private function getGroup($name) {
155
		switch ($name) {
156
			case 'guest':
157
				if ($this->guestGroup === null) {
158
					$this->guestGroup = GroupQuery::create()->filterByIsGuest(true)->findOne();
159
				}
160
				return $this->guestGroup;
161
	
162
			case 'user':
163
				if ($this->userGroup === null) {
164
					$this->userGroup = GroupQuery::create()->filterByIsDefault(true)->findOne();
165
				}
166
				return $this->userGroup;
167
	
168
			case 'admin':
169
				if ($this->adminGroup === null) {
170
					$this->adminGroup = GroupQuery::create()->findOneById(3);
171
				}
172
				return $this->adminGroup;
173
		}
174
	}
175
	
176
	private function updateApi(Module $model, $actions) {
177
		$repo = $this->service->getResourceRepository();

src/package/ModuleManager.php 1 location

@@ 239-259 (lines=21) @@
236
	 * @param string $name
237
	 * @return Group
238
	 */
239
	private function getGroup($name) {
240
		switch ($name) {
241
			case 'guest':
242
				if ($this->guestGroup === null) {
243
					$this->guestGroup = GroupQuery::create()->filterByIsGuest(true)->findOne();
244
				}
245
				return $this->guestGroup;
246
247
			case 'user':
248
				if ($this->userGroup === null) {
249
					$this->userGroup = GroupQuery::create()->filterByIsDefault(true)->findOne();
250
				}
251
				return $this->userGroup;
252
				
253
			case 'admin':
254
				if ($this->adminGroup === null) {
255
					$this->adminGroup = GroupQuery::create()->findOneById(3);
256
				}
257
				return $this->adminGroup;
258
		}
259
	}
260
261
	private function installApi(Module $module, $data, $actionMap) {
262
		if (!isset($data['api'])) {