You are here

protected function ConfigFormTest::getFileList in Flysystem 8

Same name and namespace in other branches
  1. 3.x tests/src/Unit/Form/ConfigFormTest.php \Drupal\Tests\flysystem\Unit\Form\ConfigFormTest::getFileList()
  2. 2.0.x tests/src/Unit/Form/ConfigFormTest.php \Drupal\Tests\flysystem\Unit\Form\ConfigFormTest::getFileList()
  3. 3.0.x tests/src/Unit/Form/ConfigFormTest.php \Drupal\Tests\flysystem\Unit\Form\ConfigFormTest::getFileList()

Converts a file list fron Flysystem into a list of files.

Parameters

array $list: The file list from Flysystem::listContents().

Return value

string[] A list of file paths.

File

tests/src/Unit/Form/ConfigFormTest.php, line 240

Class

ConfigFormTest
@coversDefaultClass \Drupal\flysystem\Form\ConfigForm @group flysystem

Namespace

Drupal\Tests\flysystem\Unit\Form

Code

protected function getFileList(array $list) {
  $list = array_filter($list, function (array $file) {
    return $file['type'] === 'file';
  });
  return array_map(function (array $file) {
    return $file['path'];
  }, $list);
}