Skip to content

Releases: ScreamingDev/phpsemver

3.2.0 - Ready for your CI

14 Jan 17:15
Compare
Choose a tag to compare

Now you can tell exactly which files to parse
and create configs per project out of a good bunch of rules.
PHPSemVer is ready for your development environment
and want's to be integrated in your CI / quality assurance for your next release.

Bug Fixes

  • Console / CLI: Empty XML-Configs no longer throw an exception
  • Deep comparison:
    Only the signatures (class-name, function-name, ...) were compared with each another.
    All sub nodes are now used and given to the rule sets / trigger.
  • Changed bodies were not always detected:
    Due to wrong boolean logic while checking contents of functions
    and methods the "BodyChanged"-Trigger did not always detected changes within the function/method.
  • Match filter against relative path:
    Pattern were matched against the realpath (e.g. "/var/project/foo/bar.php")
    which will fail when using start and end delimiter like "^name$".
    Only the relative path is compare now (e.g. "foo/bar.php").
  • Proper XML-Path for some config nodes
    • \PHPSemVer\Config\RuleSet::XPATH corrected,
      was wrong and blocked parsing some configurations.

Features

Console

  • Local phpsemver.xml will be used:
    When there is a "phpsemver.xml" file in your project root,
    then PHPSemVer will automatically load this config instead of the default SemVer2 config.
  • SemVer2 is default rule set when none is given
  • Progress bar while fetching files:
    A progress bar is shown in verbose-mode that shows how long the action will take in minutes.
    This is done due to many large projects waiting for the results.
    PHPSemVer now indicates that it is working instead of idling silently.

Config

  • Choose which files and folders to scan:
    The <Filter> has now a section called <Whitelist> to choose which folder shall be parsed
    and compared.
    It works like the <Blacklist> filter.

Rule sets

  • Rule set for Atoum 2 (called "Atoum")
  • Rule set for Drupal 8 (called "Drupal-Core")

Trigger

  • Interface added:
    Check if an interface has been added.
    This is included in the SemVer2 Rule as a minor change.
  • Interface removed:
    Check if an interface has been removed.
    This is included in the SemVer2 Rule as a major change.

Breaking changes

There are no known breaking changes.

Use it for commit messages

10 Jan 19:03
Compare
Choose a tag to compare
  • Use vcs:message to generate commit messages
    • Option --prefix can change the line-by-line prefix.
    • Option --include only shows messages for particular rule sets.
  • If a file phpsemver.xml is given then it will be used instead of the default "SemVer2".

VCS Message

Generate powerful commit messages depending on your changes:

bin/phpsemver vcs:message --prefix '# - ' HEAD . | cat - $1 > $1.phpsemver

Which will create these lines for you

# - PHPSemVer\Console\AbstractCommand::getConfig() added
# - PHPSemVer\Console\AbstractCommand::getEnvironment() added
# - PHPSemVer\Console\CompareCommand::execute() body changed
# - PHPSemVer\Trigger\Classes\IsRemoved::handle() body changed
# - PHPSemVer\Wrapper\Directory::getAllFileNames() body changed

Try it as a git prepare-commit-msg hook ;)
https://github.com/sourcerer-mike/phpsemver/wiki/VCS-Message

PHPSemVer 3 - Extensible and yours

02 Jan 19:00
Compare
Choose a tag to compare

Tell the tool your rules about versions, get rid of that headaches and focus on development again!

The next major version uses a complete different approach to parse PHP files.
Refactoring PHPSemVer makes it now strong enough for a lot of new features on the roadmap:

  • A neat little helper for commit messages.
    Let the tool prefill the commit message with some big changes
    in classes, methods or functions.
  • Generator for changelogs.
    Generate changelogs by using the doc-comments of changed
    classes, methods and functions.
  • Test-Tool for your continous integration (CI).
    Write your own rules and use phpsemver in CI to fulfill them anytime.

Enhancements

The new 3.0.0 comes with the following features.

Config

  • Own configurations (via XML-Files) to maintain own rules and exclude directories.
    A XSD-File helps for autocompletion in your IDE.

Semantic just means to follow rules. Use your own or use the SemVer2 rules which are already included.

Assertions

  • Functions
    • IsAdded: Check if a function is new.
    • IsRemoved: Check if a functions 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.

Expect more to come ;) and please suggest some in the issue tracker.

Others

  • A lot more message for verbose and debug mode.
  • Faster handling GIT-Repositories due to persist caching.
  • Better strategy to find composer autoloader.

Backwards incompatible changes

  • phpsemver_get_composer_config() removed
    due to a new strategy for resolving path to composer autoloader.
  • \PHPSemVer\Specification no longer needed
    due to complete usage of Nikic/PHP-Parser.
  • PHPSemVer\DataTree\Importer\NikicParser removed
    due to complete usage of Nikic/PHP-Parser.
  • Following methods were an adapter to another PHP-Parser
    and are no longer needed:
    • PHPSemVer\Wrapper\AbstractWrapper::_getCache()
    • PHPSemVer\Wrapper\AbstractWrapper::_getCacheFactory()
    • PHPSemVer\Wrapper\AbstractWrapper::getAllPaths()
    • PHPSemVer\Wrapper\AbstractWrapper::getParser()
    • PHPSemVer\Wrapper\AbstractWrapper::getParserExceptions()
  • PHPSemVer\Wrapper\Git::__destruct() removed
    due to better caching and perfomance.