You are here

public function FlysystemBridge::getName in Flysystem 8

Same name and namespace in other branches
  1. 3.x src/FlysystemBridge.php \Drupal\flysystem\FlysystemBridge::getName()
  2. 2.0.x src/FlysystemBridge.php \Drupal\flysystem\FlysystemBridge::getName()
  3. 3.0.x src/FlysystemBridge.php \Drupal\flysystem\FlysystemBridge::getName()

Returns the name of the stream wrapper for use in the UI.

Return value

string The stream wrapper name.

Overrides StreamWrapperInterface::getName

File

src/FlysystemBridge.php, line 27

Class

FlysystemBridge
An adapter for Flysystem to StreamWrapperInterface.

Namespace

Drupal\flysystem

Code

public function getName() {
  $scheme = $this
    ->getProtocol();
  $name = (string) $this
    ->getFactory()
    ->getSettings($scheme)['name'];
  $default = $this
    ->t('Flysystem: @scheme', [
    '@scheme' => $scheme,
  ]);
  return $name !== '' ? $this
    ->t($name) : $default;
}