Skip to content

Releases: navarr/dependency-annotation

v2.1.0-alpha.1

14 Jul 15:11
00e6a21
Compare
Choose a tag to compare
v2.1.0-alpha.1 Pre-release
Pre-release
  • Adds depanno entry point
  • Adds depanno why-block composer/package version directory command
  • Adds DirectoryScopeDeterminer

🎉 Version 2 🎉

11 Jul 19:53
9af08fc
Compare
Choose a tag to compare

After a lot of hard work, I'm proud to present Version 2 of navarr/dependency-annotation!

Addition and preference of PHP8 Attribute

This library now uses a PHP8 attribute as it's preference when parsing dependencies, making the package name a little bit of a misnomer. This does not mean the project is limited to PHP8, however! PHP8 Attributes are fully compatible with older versions of PHP so long as they do not take up more than one line.

The preferred way of declaring your dependencies is, to now:

$> composer require --dev navarr/attribute-dependency

And then, in your PHP code:

use Navarr\Attribute\Dependency;

class SomeClass
{
    #[Dependency('example/some-package', '>=5', 'Why we\'ve chosen this constraint')]
    public function execute() { /* ... */ }
}

By default, the tool will no longer search for or output annotations. If you would like to run this on older codebases, you can include the flag --include-legacy-annotations.

Additional methods of output

Our only command is still composer why-block for now, but we've expanded the available output formats. You can pass flag --format or -f with a value of text, csv, json, or xml! In all cases, the results will be written to standard out and can be redirected into a file or piped into a utility like jq.

Improved Stability

I have gone absolutely crazy with testing. This repository uses phpstan at the strictest available level, runs at least 80 unit tests with over 250 assertions, and the output of the Infection mutation testing library is paid attention to for hardening to ensure edge cases are being covered.

Final Version of why-block

$> composer help why-block
Usage:
  why-block [options] [--] <package> <version>

Arguments:
  package                           Package to inspect
  version                           Version you want to update it to

Options:
  -f, --format[=FORMAT]             Format to output results in.  Accepted values: text, csv, json, xml [default: "text"]
  -e, --fail-on-error               Immediately fail on parsing errors
  -l, --include-legacy-annotations  Include old @dependency/@composerDependency annotations in search
  -r, --include-root-dependencies   Search root dependencies for the @dependency annotation
  -a, --include-all-dependencies    Search all dependencies for the @dependency annotation
  -h, --help                        Display help for the given command. When no command is given display help for the list command
  -q, --quiet                       Do not output any message
  -V, --version                     Display this application version
      --ansi|--no-ansi              Force (or disable --no-ansi) ANSI output
  -n, --no-interaction              Do not ask any interactive question
      --profile                     Display timing and memory usage information
      --no-plugins                  Whether to disable plugins.
  -d, --working-dir=WORKING-DIR     If specified, use the given directory as working directory.
      --no-cache                    Prevent use of the cache
  -v|vv|vvv, --verbose              Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

v2.0.0-beta.6

11 Jul 03:55
dffceae
Compare
Choose a tag to compare
v2.0.0-beta.6 Pre-release
Pre-release
  • BREAKING: Moved -f (fail on error) to -e
  • Added a --format|-f flag that accepts text, csv, json, or xml
  • Added support for navarr/attribute-dependency v1.0.1 (new property "required")
  • Continued improving testability

v2.0.0-beta.5

04 Jul 20:08
e8a4129
Compare
Choose a tag to compare
v2.0.0-beta.5 Pre-release
Pre-release
  • Updated AstParser to throw less errors (and instead, ignore lines where there are issues)
  • Updated LegacyParser to catch more annotations than it did in v1 (that it should've caught)
  • Added more tests

v2.0.0-beta.4

29 Jun 03:25
75997cb
Compare
Choose a tag to compare
v2.0.0-beta.4 Pre-release
Pre-release
  • Added a --fail-on-error / -f flag to immediately fail if a PHP file cannot be parsed
  • Improved validation of attributes
  • Improved handling errors during parsing
  • Reduced technical debt
  • Added automated testing for the AST Parser

v2.0.0-beta.3

23 Jun 19:17
103ee3e
Compare
Choose a tag to compare
v2.0.0-beta.3 Pre-release
Pre-release
  • Resolves issue where command would fail with an error when trying to determine what to do with a non-php file

v2.0.0-beta.2

22 Jun 03:43
7ed4a09
Compare
Choose a tag to compare
v2.0.0-beta.2 Pre-release
Pre-release
  • Resolves an issue where code was not installable on PHP 8

v2.0.0-beta.1

22 Jun 03:28
c792d5c
Compare
Choose a tag to compare
v2.0.0-beta.1 Pre-release
Pre-release
  • Maintains compatibility with PHP 7
  • Adds a PHP8 Attribute #[Dependency]
  • Adds a -l option for backwards compatibility with old annotations

v1.0.1

27 May 18:38
b7d3419
Compare
Choose a tag to compare
  • Adds support for Composer v2

v1.0.0.1

05 Jul 06:57
Compare
Choose a tag to compare

Changes:

  • Files unnecessary to installations have been excluded from packaging