Coder Social home page Coder Social logo

SemVer parsing about semver HOT 5 CLOSED

antonkomarev avatar antonkomarev commented on September 27, 2024
SemVer parsing

from semver.

Comments (5)

antonkomarev avatar antonkomarev commented on September 27, 2024 1

I think that constructor should accept only versions of 100% correct format, but there could be an extra method which will try to make a guess.

$version = \PHLAK\SemVer\Version::parse('1.0');

from semver.

PHLAK avatar PHLAK commented on September 27, 2024 1

Added in v3.2.0

from semver.

PHLAK avatar PHLAK commented on September 27, 2024

I'm not sure how I feel about this.

  • If the class is initialized with a version of 1.0 would the library handle it as 1.0 or 1.0.0?
  • If the minor version is incremented would the version now be 1.1 or 1.1.0?
  • If the major version is incremented would the version new version be 2.0 or 2.0.0?

from semver.

antonkomarev avatar antonkomarev commented on September 27, 2024

I think if it's SemVer - it should have 3 digits delimited with points. If 1.0 passed - it should be instantiated as 1.0.0, and then minor version increment will be 1.1.0 and major version increment will be 2.0.0.

from semver.

pokono avatar pokono commented on September 27, 2024

Maybe there should be an option to make the patch number optional. It's common to hide the patch number if it's zero.

from semver.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.