You are here

public static function ExtensionLifecycle::isValid in Drupal 9

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);
}