Code Duplication    Length = 8-8 lines in 2 locations

src/model/serializer/UserSerializer.php 2 locations

@@ 64-71 (lines=8) @@
61
		$this->addGroups($model, $data);
62
	}
63
	
64
	public function addGroups($model, $data) {
65
		foreach ($data as $item) {
66
			$group = GroupQuery::create()->findOneById($item['id']);
67
			if ($group !== null) {
68
				$model->addGroup($group);
69
			}
70
		}
71
	}
72
	
73
	public function removeGroups($model, $data) {
74
		foreach ($data as $item) {
@@ 73-80 (lines=8) @@
70
		}
71
	}
72
	
73
	public function removeGroups($model, $data) {
74
		foreach ($data as $item) {
75
			$group = GroupQuery::create()->findOneById($item['id']);
76
			if ($group !== null) {
77
				$model->removeGroup($group);
78
			}
79
		}
80
	}
81
}