Code Duplication    Length = 13-14 lines in 3 locations

lib/Service/TemplatesService.php 1 location

@@ 130-143 (lines=14) @@
127
	 *
128
	 * @return array
129
	 */
130
	private function getDirectoriesFromTemplatesDir() {
131
132
		$allTemplates = [];
133
		foreach (new DirectoryIterator(self::TEMPLATE_DIR) as $file) {
134
135
			if (!$file->isDir() || substr($file->getFilename(), 0, 1) === '.') {
136
				continue;
137
			}
138
139
			$allTemplates[] = $file->getFilename();
140
		}
141
142
		return $allTemplates;
143
	}
144
145
146
	/**

lib/Service/ThemesService.php 1 location

@@ 131-144 (lines=14) @@
128
	 *
129
	 * @return array
130
	 */
131
	private function getDirectoriesFromThemesDir() {
132
133
		$allThemes = [];
134
		foreach (new DirectoryIterator(self::THEMES_DIR) as $file) {
135
136
			if (!$file->isDir() || substr($file->getFilename(), 0, 1) === '.') {
137
				continue;
138
			}
139
140
			$allThemes[] = $file->getFilename();
141
		}
142
143
		return $allThemes;
144
	}
145
146
}

lib/Service/FileService.php 1 location

@@ 74-86 (lines=13) @@
71
72
73
//	public function getAppDataFolderContent($dir) {
74
	public function getDirectoriesFromAppDataFolder($dir) {
75
// do we still use DirectoryIterator as files are in DB ?
76
		$all = [];
77
		foreach (new DirectoryIterator($this->getAppDataFolderAbsolutePath($dir)) as $file) {
78
			if (!$file->isDir() || substr($file->getFilename(), 0, 1) === '.') {
79
				continue;
80
			}
81
82
			$all[] = $file->getFilename();
83
		}
84
85
		return $all;
86
	}
87
88
89
	/**