phly / keep-a-changelog

Tools for manipulating CHANGELOG.md files in Keep A Changelog format, including tagging and releasing.
https://phly.github.io/keep-a-changelog/
BSD 2-Clause "Simplified" License
182 stars 23 forks source link

fix: add missing use statement to fix class not found error #79

Closed ramsey closed 4 years ago

ramsey commented 4 years ago

While attempting to use keep-a-changelog bump:minor for the first time, I encountered the following error:

PHP Fatal error:  Uncaught Error: Class 'Phly\KeepAChangelog\Bump\Exception\ChangelogEntriesNotFoundException' not found in /path/to/ramsey/devtools/vendor/phly/keep-a-changelog/src/Bump/ChangelogBump.php:70

I investigated and found that the exception class was not resolving properly because of a missing use statement. This PR adds the missing use statement and includes a test to ensure the exception is thrown.

Now, the bump:minor command properly responds with this, if it can't find any changelog entries:

In ChangelogEntriesNotFoundException.php line 21:

  Unable to find any changelog entries in file /path/to/ramsey/devtools/CHANGELOG.md; is it  
   formatted correctly?                                                                                     

bump:minor [-m|--create-milestone] [--create-milestone-with-name CREATE-MILESTONE-WITH-NAME]