Code Duplication    Length = 13-15 lines in 3 locations

src/File.php 3 locations

@@ 200-212 (lines=13) @@
197
	 * @param bool $showHidden = false
198
	 * @return string[] an array with the files and directories in the current directory.
199
	 */
200
	public function listAll($recursive = false, $showHidden = false)
201
	{
202
		$result = [];
203
204
		foreach ($this->listAllIterator($recursive, $showHidden) as $element) {
205
			$result[] = $element->getFilename();
206
		}
207
208
		return $result;
209
	}
210
211
	/**
212
	 * Returns an array with the directories in the current directory.
213
	 *
214
	 * @param bool $recursive = false
215
	 * @param bool $showHidden = false
@@ 218-232 (lines=15) @@
215
	 * @param bool $showHidden = false
216
	 * @return string[] an array with the directories in the current directory.
217
	 */
218
	public function listDirectories($recursive = false, $showHidden = false)
219
	{
220
		$result = [];
221
222
		foreach ($this->listAllIterator($recursive, $showHidden) as $element) {
223
			if ($element->isDir()) {
224
				$result[] = $element->getFilename();
225
			}
226
		}
227
228
		return $result;
229
	}
230
231
	/**
232
	 * Returns an array with the files in the current directory.
233
	 *
234
	 * @param bool $recursive = false
235
	 * @param bool $showHidden = false
@@ 238-252 (lines=15) @@
235
	 * @param bool $showHidden = false
236
	 * @return string[] an array with the files in the current directory.
237
	 */
238
	public function listFiles($recursive = false, $showHidden = false)
239
	{
240
		$result = [];
241
242
		foreach ($this->listAllIterator($recursive, $showHidden) as $element) {
243
			if ($element->isFile()) {
244
				$result[] = $element->getFilename();
245
			}
246
		}
247
248
		return $result;
249
	}
250
251
	/**
252
	 * Returns true if the file has been created.
253
	 *
254
	 * @param bool $override = false
255
	 * @return bool true if the file has been created.