naneau / semver

PHP Semantic Versioning library
MIT License
73 stars 9 forks source link

fixing modified version string #13

Closed schorsch3000 closed 9 years ago

schorsch3000 commented 9 years ago

it is all about https://github.com/naneau/semver/issues/12

What's this PR do?

it modifies the SortTest::testSortStrings() to also sort a version in question (0.0.1-alpha) the test checks if it is the Smallest (prior to 0.0.1) and if it returns in it original state.

also it fixes this issue by storing the original version string in the version instance createt by the Parser and returns ist on __toString()

Where should the reviewer start?

this is a quite small pr, run the new test on the old code, on the new code and look up the diff

How should this be manually tested?

there is a example in the issue, test this with and without the PR

Any background context you want to provide?

0.0.1-alpha is a valid semver 2.0 version, this format is an example in §9 on semver.org

What are the relevant tickets?

https://github.com/naneau/semver/issues/12

Questions:

why do we call the parser to give us a version-object? shouldn't we create a version-object which uses the parser to get it's information?

naneau commented 9 years ago

@schorsch3000 Thanks for taking the effort to fix this! The PR looks fine, other than a minor thing regarding a missing docblock for the method you introduced. Could you fix it? If not I'll merge it as is and add it myself.

schorsch3000 commented 9 years ago

@naneau I'll can fix the missing doc-block today after work and send another pullrequest.