Static list function

This commit is contained in:
Dennis Eichhorn 2017-02-20 19:15:10 +01:00
parent a937a4f8aa
commit 62399ac021

View File

@ -72,6 +72,17 @@ class Directory extends FileAbstract implements DirectoryInterface
}
}
public static function list(string $path, string $filter = '*') : array
{
$list = [];
foreach (glob($path . DIRECTORY_SEPARATOR . $filter) as $filename) {
$list[] = $filename;
}
return $list;
}
/**
* {@inheritdoc}
*/