public function getStability()
    {
        if (is_null($this->stability) === false) {
            return $this->stability;
        }

        if (preg_match('{^[^,\s]*?@('.implode('|', array_keys(BasePackage::$stabilities)).')$}i', $this->getVersion(), $match)) {
            $stability = $match[1];
        } else {
            $stability = VersionParser::parseStability($this->getVersion());
        }

        $this->stability = VersionParser::normalizeStability($stability);

        return $this->stability;
    }