Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add high level library functions #2

Closed
Seldaek opened this issue Jul 15, 2015 · 1 comment
Closed

Add high level library functions #2

Seldaek opened this issue Jul 15, 2015 · 1 comment

Comments

@Seldaek
Copy link
Member

Seldaek commented Jul 15, 2015

Some inspiration can be found at https://github.com/npm/node-semver#functions - I think it'd be nice to have a more comprehensive toolkit than version_compare in PHP. We have all the underlying code just needs to be made a bit more usable as a wrapper class or something.

@legoktm legoktm mentioned this issue Jul 15, 2015
@legoktm
Copy link
Contributor

legoktm commented Jul 15, 2015

Here are the functions that npm has under "compare":

  • valid
  • increment
  • major
  • minor
  • patch
  • gt - greaterThan
  • gte - greaterThanOrEqualTo
  • lt - lessThan
  • lte - lessThanOrEqualTo
  • eq - equalTo
  • neq - notEqualTo
  • cmp - compare
  • compare
  • rcompare
  • diff

I'll take a stab at implementing some of them.

legoktm added a commit to legoktm/semver that referenced this issue Jul 16, 2015
Part of composer#2.

Implements helper functions for greater than, greater than or equal to,
less than, less than or equal to, equal to, and not equal to.

They all call Compare:compare() which takes an arbitrary comparison
operator.
legoktm added a commit to legoktm/semver that referenced this issue Jul 18, 2015
Part of composer#2.

Implements helper functions for greater than, greater than or equal to,
less than, less than or equal to, equal to, and not equal to.

They all call Comparator::compare() which takes an arbitrary comparison
operator.
legoktm added a commit to legoktm/semver that referenced this issue Jul 21, 2015
Part of composer#2.

Implements helper functions for greater than, greater than or equal to,
less than, less than or equal to, equal to, and not equal to.

They all call Comparator::compare() which takes an arbitrary comparison
operator.
@Seldaek Seldaek closed this as completed Sep 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants