Code Duplication    Length = 9-9 lines in 4 locations

lib/Service/FilesService.php 4 locations

@@ 771-779 (lines=9) @@
768
	 * @param array $share
769
	 * @param array $users
770
	 */
771
	private function parseUsersShares($share, &$users) {
772
		if ((int)$share['share_type'] !== Constants::SHARE_TYPE_USER) {
773
			return;
774
		}
775
776
		if (!in_array($share['share_with'], $users)) {
777
			$users[] = $share['share_with'];
778
		}
779
	}
780
781
782
	/**
@@ 786-794 (lines=9) @@
783
	 * @param array $share
784
	 * @param array $groups
785
	 */
786
	private function parseUsersGroups($share, &$groups) {
787
		if ((int)$share['share_type'] !== Constants::SHARE_TYPE_GROUP) {
788
			return;
789
		}
790
791
		if (!in_array($share['share_with'], $groups)) {
792
			$groups[] = $share['share_with'];
793
		}
794
	}
795
796
797
	/**
@@ 801-809 (lines=9) @@
798
	 * @param array $share
799
	 * @param array $circles
800
	 */
801
	private function parseUsersCircles($share, &$circles) {
802
		if ((int)$share['share_type'] !== Constants::SHARE_TYPE_CIRCLE) {
803
			return;
804
		}
805
806
		if (!in_array($share['share_with'], $circles)) {
807
			$circles[] = $share['share_with'];
808
		}
809
	}
810
811
812
	/**
@@ 816-824 (lines=9) @@
813
	 * @param array $share
814
	 * @param array $links
815
	 */
816
	private function parseUsersLinks($share, &$links) {
817
		if ((int)$share['share_type'] !== Constants::SHARE_TYPE_LINK) {
818
			return;
819
		}
820
821
		if (!in_array($share['share_with'], $links)) {
822
			$links[] = $share['share_with'];
823
		}
824
	}
825
826
827
}