Code Duplication    Length = 23-23 lines in 2 locations

lib/Service/FileService.php 2 locations

@@ 95-117 (lines=23) @@
92
	 *
93
	 * @return string[]
94
	 */
95
	public function getSourceFiles($base, $dir = '') {
96
97
		$base = MiscService::endSlash($base);
98
		$dir = MiscService::endSlash($dir);
99
100
		$files = [];
101
		foreach (new DirectoryIterator($base . $dir) as $file) {
102
103
			if (substr($file->getFilename(), 0, 1) === '.') {
104
				continue;
105
			}
106
107
			if ($file->isDir()) {
108
				$files[] = $dir . $file->getFilename() . '/';
109
				$files = array_merge($files, $this->getSourceFiles($base, $dir . $file->getFilename()));
110
				continue;
111
			}
112
113
			$files[] = $dir . $file->getFilename();
114
		}
115
116
		return $files;
117
	}
118
119
120
	/**
@@ 128-150 (lines=23) @@
125
	 *
126
	 * @return string[]
127
	 */
128
	public function getAppDataFiles($base, $dir = '') {
129
130
		$base = MiscService::endSlash($base);
131
		$dir = MiscService::endSlash($dir);
132
133
		$files = [];
134
		foreach (new DirectoryIterator($base . $dir) as $file) {
135
136
			if (substr($file->getFilename(), 0, 1) === '.') {
137
				continue;
138
			}
139
140
			if ($file->isDir()) {
141
				$files[] = $dir . $file->getFilename() . '/';
142
				$files = array_merge($files, $this->getSourceFiles($base, $dir . $file->getFilename()));
143
				continue;
144
			}
145
146
			$files[] = $dir . $file->getFilename();
147
		}
148
149
		return $files;
150
	}
151
152
153
	/**