Back to ExtensionAdapter class

Method stabilityTagToInteger

protected int
stabilityTagToInteger
(mixed $tag)
Converts a tag to numeric stability representation. If the tag doesn't represent a known stability level (one of dev, alpha, beta, rc, stable) it is ignored.
Parameters
  • string $tag The tag string, e.g. dev, alpha, beta, rc, stable
Returns
  • int
Since
  • 3.4

Method stabilityTagToInteger - Source code

/**
 * Converts a tag to numeric stability representation. If the tag doesn't represent a known stability level (one of
 * dev, alpha, beta, rc, stable) it is ignored.
 *
 * @param   string  $tag  The tag string, e.g. dev, alpha, beta, rc, stable
 *
 * @return  integer
 *
 * @since   3.4
 */
protected function stabilityTagToInteger($tag)
{
    $constant = '\\Joomla\\CMS\\Updater\\Updater::STABILITY_' . strtoupper($tag);
    if (\defined($constant)) {
        return \constant($constant);
    }
    return Updater::STABILITY_STABLE;
}