2017 © Pedro Peláez
 

library phpsemver

Compare two version and check for semantic versioning.

image

sourcerer-mike/phpsemver

Compare two version and check for semantic versioning.

  • Sunday, September 18, 2016
  • by sourcerer-mike
  • Repository
  • 1 Watchers
  • 29 Stars
  • 61 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 13 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

PHPSemVer

Check your changes against semantic versions, (*1)

Build Status Coverage, (*2)

Install it via composer, (*3)

composer require sourcerer-mike/phpsemver

and test your code by comparing two versions, (*4)

phpsemver compare 3.2.0 HEAD

or the last commit with your current work:, (*5)

phpsemver compare HEAD .

+-------+-------------------------------------------------------------------+
| Level | Message                                                           |
+-------+-------------------------------------------------------------------+
| major | phpsemver_get_composer_config() removed.                          |
| major | PHPSemVer\Specification removed.                                  |
| minor | PHPSemVer\Config added.                                           |
| minor | PHPSemVer\Wrapper\AbstractWrapper::mergeTrees() added.            |
| patch | PHPSemVer\Wrapper\Directory::getAllFileNames() body changed.      |
| patch | PHPSemVer\Wrapper\Git::getAllFileNames() body changed.            |
+-------+-------------------------------------------------------------------+

Total time: 0.94

You're welcome!, (*6)

Features

Commands

Try the several possibilities:, (*7)

  • Use compare to check for changes.
  • Use vcs:message to enhance your commit messages.

Wrapper

Choose between those wrapper(phpsemver compare --type ...):, (*8)

  • GIT
  • Filesystem / Directories

If one argument is a directory, then the system will work on the file system., (*9)

Assertions

Make assertions on:, (*10)

  • Functions
    • IsAdded: Check if a function is new.
    • IsRemoved: Check if a function is removed.
    • BodyChanged: Check if someone changed the behaviour of a function.
  • Classes
    • IsAdded: Check if a classes is new.
    • IsRemoved: Check if a classes is removed.
  • Methods
    • IsAdded: Check if a method is new.
    • IsRemoved: Check if a method is removed.
    • BodyChanged: Check if someone changed the behaviour of a method.
    • ReturnTypeChanged: Watch for changed return types.
    • ReturnTypeRemoved: Watch for incompatible changes on methods.
  • Interfaces
    • IsAdded: Check if an interface is new.
    • IsRemoved: Check if an interface is removed.

Combine them as you like in your own configuration file., (*11)

Configuration

Configure which assertions are used in a XML-File. The delivered XSD file makes it easy to write your own configuration (in a proper IDE)., (*12)

<?xml version="1.0"?>
<phpsemver
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/sourcerer-mike/phpsemver/3.2.0/etc/phpsemver.xsd"
        title="My own rules">
    <RuleSet name="major">
        <Trigger>
            <Functions>
                <IsRemoved />
            </Functions>
        </Trigger>
    </RuleSet>
    <RuleSet name="minor">
        <Trigger>
            <Classes>
                <IsAdded />
            </Classes>
        </Trigger>
    </RuleSet>
    <RuleSet name="patch">

    </RuleSet>
    <Filter>
        <Whitelist>
            <Pattern>@lib/.*@</Pattern>
        </Whitelist>
        <Blacklist>
            <Pattern>@lib/Test/.*@</Pattern>
        </Blacklist>
    </Filter>
</phpsemver>

Write your own and use it with the --ruleset option. See the wiki entry for more information: https://github.com/sourcerer-mike/phpsemver/wiki/Configuration, (*13)

Prepared rule sets

Those projects do semantic versions in different ways. So a special config is written for them which can be used via the --ruleSet option:, (*14)

  • Drupal-Core
  • SemVer2
  • WordPress

Just write phpsemver --ruleSet Drupal-Core and see the latest changes in Drupal. There are other companies that follow some semantics in their rules like Symfony. Don't drag behind - catch up with PHPSemVer., (*15)

The Versions

18/09 2016
18/09 2016

dev-feature/fetch-parse-errors

dev-feature/fetch-parse-errors https://github.com/sourcerer-mike/phpsemver

Compare two version and check for semantic versioning.

  Sources   Download

MIT

The Requires

 

The Development Requires

static code analysis code analysis semantic version code tool

14/01 2016
14/01 2016
10/01 2016

dev-support/3.x.x

dev-support/3.x.x https://github.com/sourcerer-mike/phpsemver

Compare two version and check for semantic versioning.

  Sources   Download

MIT

The Requires

 

The Development Requires

static code analysis code analysis semantic version code tool

10/01 2016
02/01 2016

3.0.0

3.0.0.0 https://github.com/sourcerer-mike/phpsemver

Compare two version and check for semantic versioning.

  Sources   Download

MIT

The Requires

 

The Development Requires

static code analysis code analysis semantic version code tool

01/12 2015

1.0.2

1.0.2.0 https://github.com/sourcerer-mike/phpsemver

Compare two version and check for semantic versioning.

  Sources   Download

The Requires

 

The Development Requires

static code analysis code analysis semantic version code tool

29/11 2015

2.1.1

2.1.1.0 https://github.com/sourcerer-mike/phpsemver

Compare two version and check for semantic versioning.

  Sources   Download

The Requires

 

The Development Requires

static code analysis code analysis semantic version code tool

29/11 2015

2.1.0

2.1.0.0 https://github.com/sourcerer-mike/phpsemver

Compare two version and check for semantic versioning.

  Sources   Download

The Requires

 

The Development Requires

static code analysis code analysis semantic version code tool

29/11 2015

2.0.0

2.0.0.0 https://github.com/sourcerer-mike/phpsemver

Compare two version and check for semantic versioning.

  Sources   Download

The Requires

 

The Development Requires

static code analysis code analysis semantic version code tool

27/11 2015

1.0.1

1.0.1.0 https://github.com/sourcerer-mike/phpsemver

Compare two version and check for semantic versioning.

  Sources   Download

The Requires

 

The Development Requires

static code analysis code analysis semantic version code tool

27/11 2015

1.0.0

1.0.0.0 https://github.com/sourcerer-mike/phpsemver

Compare two version and check for semantic versioning.

  Sources   Download

The Requires

 

The Development Requires

static code analysis code analysis semantic version code tool