function Extension::isExperimental

Same name in other branches
  1. 10 core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::isExperimental()
  2. 11.x core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::isExperimental()

Checks if an extension is marked as experimental.

Return value

bool TRUE if an extension is marked as experimental, FALSE otherwise.

File

core/lib/Drupal/Core/Extension/Extension.php, line 202

Class

Extension
Defines an extension (file) object.

Namespace

Drupal\Core\Extension

Code

public function isExperimental() : bool {
    // Currently, this function checks for both the key/value pairs
    // 'experimental: true' and 'lifecycle: experimental' to determine if an
    // extension is marked as experimental.
    // @todo Remove the check for 'experimental: true' as part of
    // https://www.drupal.org/node/3250342
    return isset($this->info['experimental']) && $this->info['experimental'] || isset($this->info[ExtensionLifecycle::LIFECYCLE_IDENTIFIER]) && $this->info[ExtensionLifecycle::LIFECYCLE_IDENTIFIER] === ExtensionLifecycle::EXPERIMENTAL;
}

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