Code Duplication    Length = 13-14 lines in 2 locations

lib/Service/TemplatesService.php 1 location

@@ 118-130 (lines=13) @@
115
	 *
116
	 * @return array
117
	 */
118
	public function getNewTemplatesList() {
119
120
		$newTemplates = [];
121
		$currTemplates = $this->getTemplatesList();
122
		$allTemplates = $this->fileService->getDirectoriesFromAppDataFolder(PicoService::DIR_TEMPLATES);
123
		foreach ($allTemplates as $template) {
124
			if (!in_array($template, $currTemplates)) {
125
				$newTemplates[] = $template;
126
			}
127
		}
128
129
		return $newTemplates;
130
	}
131
132
133
	/**

lib/Service/ThemesService.php 1 location

@@ 118-131 (lines=14) @@
115
	 *
116
	 * @return array
117
	 */
118
	public function getNewThemesList() {
119
120
		$newThemes = [];
121
		$currThemes = $this->getThemesList();
122
		$allThemes = $this->fileService->getDirectoriesFromAppDataFolder(PicoService::DIR_THEMES);
123
124
		foreach ($allThemes as $theme) {
125
			if (!in_array($theme, $currThemes)) {
126
				$newThemes[] = $theme;
127
			}
128
		}
129
130
		return $newThemes;
131
	}
132
133
}