Code Duplication    Length = 8-8 lines in 2 locations

src/model/serializer/UserSerializer.php 2 locations

@@ 72-79 (lines=8) @@
69
		$this->addGroups($model, $data);
70
	}
71
	
72
	public function addGroups($model, $data) {
73
		foreach ($data as $item) {
74
			$group = GroupQuery::create()->findOneById($item['id']);
75
			if ($group !== null) {
76
				$model->addGroup($group);
77
			}
78
		}
79
	}
80
	
81
	public function removeGroups($model, $data) {
82
		foreach ($data as $item) {
@@ 81-88 (lines=8) @@
78
		}
79
	}
80
	
81
	public function removeGroups($model, $data) {
82
		foreach ($data as $item) {
83
			$group = GroupQuery::create()->findOneById($item['id']);
84
			if ($group !== null) {
85
				$model->removeGroup($group);
86
			}
87
		}
88
	}
89
}