Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. VersionParser.php

function VersionParser::normalizeStability

@phpstan-return 'stable'|'RC'|'beta'|'alpha'|'dev'

Parameters

string $stability:

Return value

string

1 call to VersionParser::normalizeStability()
ConfigCommand::execute in vendor/composer/composer/src/Composer/Command/ConfigCommand.php

File

vendor/composer/semver/src/VersionParser.php, line 87

Class

VersionParser
Version parser.

Namespace

Composer\Semver

Code

public static function normalizeStability($stability) {
    $stability = strtolower((string) $stability);
    if (!in_array($stability, array(
        'stable',
        'rc',
        'beta',
        'alpha',
        'dev',
    ), true)) {
        throw new \InvalidArgumentException('Invalid stability string "' . $stability . '", expected one of stable, RC, beta, alpha or dev');
    }
    return $stability === 'rc' ? 'RC' : $stability;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal