Code Duplication    Length = 23-23 lines in 2 locations

lib/Service/FileService.php 2 locations

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