You are here

class UnusedModulesExtensionDecorator in Unused Modules 8

Decorates the core Extension object.

Hierarchy

Expanded class hierarchy of UnusedModulesExtensionDecorator

File

src/UnusedModulesExtensionDecorator.php, line 10

Namespace

Drupal\unused_modules
View source
class UnusedModulesExtensionDecorator extends Extension {

  /**
   * The Extension object.
   *
   * @var \Drupal\Core\Extension\Extension
   */
  protected $extension;

  /**
   * TRUE if the module is enabled. Defaults to FALSE.
   *
   * @var bool
   */
  public $moduleIsEnabled = FALSE;

  /**
   * Basepath of the project.
   *
   * @var string
   */
  public $projectPath = '';

  /**
   * Name of the project.
   *
   * @var string
   */
  public $projectName = '';

  /**
   * TRUE if the project contains enabled modules. Defaults to FALSE.
   *
   * @var bool
   */
  public $projectHasEnabledModules = FALSE;

  /**
   * TRUE if the parser fails.
   *
   * @var bool
   */
  public $parsingError = FALSE;

  /**
   * UnusedModulesExtensionDecorator constructor.
   *
   * @param \Drupal\Core\Extension\Extension $extension
   *   The Extension object.
   */
  public function __construct(Extension $extension) {
    $this->extension = $extension;
  }

  /**
   * Inherited from Extension.
   */
  public function getPathname() {
    return $this->extension
      ->getPathname();
  }

  /**
   * Inherited from Extension.
   */
  public function getName() {
    return $this->extension
      ->getName();
  }

  /**
   * Inherited from Extension.
   */
  public function getSubpath() {
    return $this->extension->subpath;
  }

  /**
   * Inherited from Extension.
   */
  public function getOrigin() {
    return $this->extension->origin;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Extension::$filename protected property The filename of the main extension file (e.g., 'node.module').
Extension::$pathname protected property The relative pathname of the extension (e.g., 'core/modules/node/node.info.yml').
Extension::$root protected property The app root.
Extension::$splFileInfo protected property An SplFileInfo instance for the extension's info file.
Extension::$type protected property The type of the extension (e.g., 'module').
Extension::getExtensionFilename public function Returns the name of the main extension file, if any.
Extension::getExtensionPathname public function Returns the relative path of the main extension file, if any.
Extension::getFilename public function Returns the filename of the extension's info file.
Extension::getPath public function Returns the relative path of the extension.
Extension::getType public function Returns the type of the extension.
Extension::load public function Loads the main extension file, if any.
Extension::__call public function Re-routes method calls to SplFileInfo.
Extension::__sleep public function Magic method implementation to serialize the extension object.
Extension::__wakeup public function Magic method implementation to unserialize the extension object.
UnusedModulesExtensionDecorator::$extension protected property The Extension object.
UnusedModulesExtensionDecorator::$moduleIsEnabled public property TRUE if the module is enabled. Defaults to FALSE.
UnusedModulesExtensionDecorator::$parsingError public property TRUE if the parser fails.
UnusedModulesExtensionDecorator::$projectHasEnabledModules public property TRUE if the project contains enabled modules. Defaults to FALSE.
UnusedModulesExtensionDecorator::$projectName public property Name of the project.
UnusedModulesExtensionDecorator::$projectPath public property Basepath of the project.
UnusedModulesExtensionDecorator::getName public function Inherited from Extension. Overrides Extension::getName
UnusedModulesExtensionDecorator::getOrigin public function Inherited from Extension.
UnusedModulesExtensionDecorator::getPathname public function Inherited from Extension. Overrides Extension::getPathname
UnusedModulesExtensionDecorator::getSubpath public function Inherited from Extension.
UnusedModulesExtensionDecorator::__construct public function UnusedModulesExtensionDecorator constructor. Overrides Extension::__construct