Code Duplication    Length = 9-9 lines in 4 locations

lib/Service/FilesService.php 4 locations

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