You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
860B

  1. <?php
  2. /*
  3. * This file is part of the Fxp Composer Asset Plugin package.
  4. *
  5. * (c) François Pluchino <francois.pluchino@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Fxp\Composer\AssetPlugin\Package\Version;
  11. use Composer\Package\Version\VersionParser as BaseVersionParser;
  12. /**
  13. * Lazy loader for asset package.
  14. *
  15. * @author François Pluchino <francois.pluchino@gmail.com>
  16. */
  17. class VersionParser extends BaseVersionParser
  18. {
  19. /**
  20. * Returns the stability of a version.
  21. *
  22. * @param string $version
  23. *
  24. * @return string
  25. */
  26. public static function parseStability($version)
  27. {
  28. $stability = parent::parseStability($version);
  29. return false !== strpos($version, '-patch') ? 'dev' : $stability;
  30. }
  31. }