diff --git a/CHANGELOG.md b/CHANGELOG.md index a51d9be..b6f6caa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## v1.5.0 (2024-12-07) + +### Features + + * feat: Filter relations from and to class #90 (@jose-ba) + ### Bug fix * Add argument to `--svg-topurl` in help message. diff --git a/README.md b/README.md index e442b21..7ce51e7 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,11 @@ OPTIONS --header='header string' additional header string. You can specify multiple header values. --include='wildcard' include target file pattern. (default: `*.php`) You can specify multiple include patterns. --exclude='wildcard' exclude target file pattern. You can specify multiple exclude patterns. + --rel-target-from='clases' comma separated list of classes to filter dependencies from + --rel-target-to='classes' comma separated list of classes to filter dependencies to + --rel-target='classes' comma separated list of classes to filter dependencies from or to. this option overrides + --rel-target-from and --rel-target-to if set. + --rel-target-depth=integer max depth of dependencies to show when using --from or --to filters ``` ## How to execute @@ -229,6 +234,26 @@ $ vendor/bin/php-class-diagram \ path/to/src ``` +#### option `rel-target` + +If there are a very large number of target classes, the class diagram will be cumbersome and difficult to understand. +In such a case, you can specify the classes you want to study in the `--rel-target` field to generate a class diagram for only the related classes. +By using `--rel-target-from` and `--rel-target-to`, it is also possible to further narrow down the list according to the direction of dependencies. + +```bash +$ vendor/bin/php-class-diagram \ + --rel-target-from=Entry \ + --rel-target-depth=3 \ + path/to/src +``` + +```bash +$ vendor/bin/php-class-diagram \ + --rel-target-from-from=Entry \ + --rel-target-depth=3 \ + path/to/src +``` + ### Package Diagram You can visualize package dependencies by creating a package relationship diagram using php-class-diagram. diff --git a/src/Main.php b/src/Main.php index ab78622..4a3c420 100644 --- a/src/Main.php +++ b/src/Main.php @@ -13,7 +13,7 @@ final class Main { - public const VERSION = 'v1.4.2'; + public const VERSION = 'v1.5.0'; public function __construct( private string $directory,