You are here

public function InstallablePlugin::getPreferredLibrary in Markdown 8.2

Retrieves the preferred library.

Return value

\Drupal\markdown\Annotation\InstallableLibrary|void The preferred library.

1 call to InstallablePlugin::getPreferredLibrary()
InstallablePlugin::isPreferredLibraryInstalled in src/Annotation/InstallablePlugin.php
Indicates whether the preferred library is installed.

File

src/Annotation/InstallablePlugin.php, line 58

Class

InstallablePlugin
Base annotation for "installable" plugins.

Namespace

Drupal\markdown\Annotation

Code

public function getPreferredLibrary() {
  return current(array_filter($this->libraries, function ($library) {
    return $library->preferred;
  }));
}