This function is kept only for backward compatibility.
\Drupal\Core\SystemListing::scan().
function drupal_system_listing($mask, $directory, $key = 'name', $min_depth = 1) {
// As SystemListing is required to build a dependency injection container
// from scratch and SystemListingInfo only extends SystemLising, this
// class needs to be hardwired.
$listing = new SystemListingInfo();
return $listing
->scan($mask, $directory, $key, $min_depth);
}