Comments (5)
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.
Added in v3.2.0
from semver.
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 as1.0
or1.0.0
? - If the minor version is incremented would the version now be
1.1
or1.1.0
? - If the major version is incremented would the version new version be
2.0
or2.0.0
?
from semver.
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.
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)
- Express SemVer as number HOT 2
- Undefined offset HOT 2
- Versions compare bug HOT 1
- It can check the pre-release tag HOT 4
- Doesn't work when I try to parse a chrome browser version HOT 2
- Check if there is a new patch/minor/major update HOT 4
- Add Version::isPre(), Version::hasBuild() HOT 5
- Add Version::min(), Version::max() HOT 5
- Comparing Versions with Pre-Release fail HOT 2
- git integration HOT 2
- The example in the readme is wrong
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from semver.