function ExtensionLifecycle::isValid

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

Determines if a given extension lifecycle string is valid.

Parameters

string $lifecycle: The lifecycle to validate.

Return value

bool TRUE if the lifecycle is valid, otherwise FALSE.

1 call to ExtensionLifecycle::isValid()
InfoParserDynamic::parse in core/lib/Drupal/Core/Extension/InfoParserDynamic.php
Parses Drupal module, theme and profile .info.yml files.

File

core/lib/Drupal/Core/Extension/ExtensionLifecycle.php, line 56

Class

ExtensionLifecycle
Extension lifecycle.

Namespace

Drupal\Core\Extension

Code

public static function isValid(string $lifecycle) : bool {
    $valid_values = [
        self::EXPERIMENTAL,
        self::STABLE,
        self::DEPRECATED,
        self::OBSOLETE,
    ];
    return in_array($lifecycle, $valid_values, TRUE);
}

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