function ModuleStream::getExtension

Gets the extension object.

Parameters

string $extension_name: The extension name.

Return value

\Drupal\Core\Extension\Extension The extension object.

Overrides ExtensionStreamBase::getExtension

File

core/lib/Drupal/Core/StreamWrapper/ModuleStream.php, line 40

Class

ModuleStream
Defines the read-only module:// stream wrapper for module files.

Namespace

Drupal\Core\StreamWrapper

Code

protected function getExtension(string $extension_name) : Extension {
  return \Drupal::moduleHandler()->getModule($extension_name);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.