You are here

public function FlysystemBridge::getDescription in Flysystem 3.x

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

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

Return value

string The stream wrapper description.

Overrides StreamWrapperInterface::getDescription

File

src/FlysystemBridge.php, line 38

Class

FlysystemBridge
An adapter for Flysystem to StreamWrapperInterface.

Namespace

Drupal\flysystem

Code

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