-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement ConfigBuilder #1002
Implement ConfigBuilder #1002
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the start. I cannot comment in the generated classes, but commenting on the actual config usage. It is clear to me that moving to PHP Config would require rethinking how the structure needs to look like
Is there a possibility of "working back"? What I mean is: Given a sample configuration usage, can we create a ConfigBuilder that would enable such usage? |
I think there is now enough code to discuss the current implementation/design of There are few things that still need to be done. E.g. Formatter, tests and optimise some of the implementation details of the ConfigClasses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks really promising. The php config is still rather verbose, but that's just how it is, I guess. The config objects will give us a nice way of simplifying things in the future, including the oddities around regex escaping, so 👍 from me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the config files should be in the Contract
namespace, not Supportive
.
Otherwise, I am really happy with the change. Great job!
a7ccf76
to
850cac0
Compare
This is would be another possible config. It uses static factories methods instead of the symfony configurator style. <?php
use Internal\Qossmic\Deptrac\IgnoreDependenciesOnContract;
use Internal\Qossmic\Deptrac\IgnoreDependenciesOnShouldNotHappenException;
use Qossmic\Deptrac\Contract\Analyser\ProcessEvent;
use Qossmic\Deptrac\Contract\Config\Collector\BoolConfig;
use Qossmic\Deptrac\Contract\Config\Collector\ClassNameConfig;
use Qossmic\Deptrac\Contract\Config\Collector\DirectoryConfig;
use Qossmic\Deptrac\Contract\Config\DeptracConfig;
use Qossmic\Deptrac\Contract\Config\EmitterType;
use Qossmic\Deptrac\Contract\Config\Layer;
use Qossmic\Deptrac\Contract\Config\RulesetConfig;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (DeptracConfig $config, ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(IgnoreDependenciesOnContract::class)->tag('kernel.event_listener', ['event' => ProcessEvent::class]);
$services->set(IgnoreDependenciesOnShouldNotHappenException::class)->tag(
'kernel.event_listener',
['event' => ProcessEvent::class]
);
$config
->paths('src')
->baseline('deptrac.baseline.yaml')
->analyser(
EmitterType::CLASS_TOKEN,
EmitterType::CLASS_SUPERGLOBAL_TOKEN,
EmitterType::FILE_TOKEN,
EmitterType::FUNCTION_TOKEN,
EmitterType::FUNCTION_SUPERGLOBAL_TOKEN,
EmitterType::FUNCTION_CALL,
)
->layers(
$analyser = Layer::withName('Analyser')->collectors(
DirectoryConfig::public('src/Core/Analyser/.*')
),
$ast = Layer::withName('Ast')->collectors(
DirectoryConfig::public('src/Core/Ast/.*'),
ClassNameConfig::private('^PHPStan\\\\PhpDocParser\\\\.*'),
ClassNameConfig::private('^PhpParser\\\\.*'),
ClassNameConfig::private('^phpDocumentor\\\\Reflection\\\\.*')
),
$console = Layer::withName('Console')->collectors(
DirectoryConfig::public('src/Supportive/Console/.*')
),
$dependency = Layer::withName('Dependency')->collectors(
DirectoryConfig::public('src/Core/Dependency/.*')
),
$dependencyInjection = Layer::withName('DependencyInjection')->collectors(
DirectoryConfig::public('src/Supportive/DependencyInjection/.*')
),
$contract = Layer::withName('Contract')->collectors(
DirectoryConfig::public('src/Contract/.*')
),
$inputCollector = Layer::withName('InputCollector')->collectors(
DirectoryConfig::public('src/Core/InputCollector/.*')
),
$layer = Layer::withName('Layer')->collectors(
DirectoryConfig::public('src/Core/Layer/.*')
),
$outputFormatter = Layer::withName('OutputFormatter')->collectors(
DirectoryConfig::public('src/Supportive/OutputFormatter/.*'),
ClassNameConfig::private('^phpDocumentor\\\\GraphViz\\\\.*'),
),
$file = Layer::withName('File')->collectors(
DirectoryConfig::public('src/Supportive/File/.*')
),
$supportive = Layer::withName('Supportive')->collectors(
BoolConfig::public()
->withMustNot(DirectoryConfig::public('src/Supportive/.*/.*'))
->withMust(DirectoryConfig::public('src/Supportive/.*'))
),
)
->rulesets(
RulesetConfig::layer($layer)->accesses($ast),
RulesetConfig::layer($console)->accesses($analyser, $outputFormatter, $dependencyInjection, $file),
RulesetConfig::layer($dependency)->accesses($ast),
RulesetConfig::layer($analyser)->accesses($layer, $dependency, $ast),
RulesetConfig::layer($outputFormatter)->accesses($console, $dependencyInjection),
RulesetConfig::layer($ast)->accesses($file, $inputCollector),
RulesetConfig::layer($inputCollector)->accesses($file),
RulesetConfig::layer($supportive),
RulesetConfig::layer($contract),
);
}; and for comparision the current symfony style for the deptrac.config.php use Internal\Qossmic\Deptrac\IgnoreDependenciesOnContract;
use Internal\Qossmic\Deptrac\IgnoreDependenciesOnShouldNotHappenException;
use Qossmic\Deptrac\Contract\Analyser\ProcessEvent;
use Qossmic\Deptrac\Contract\Config\DeptracConfig;
use Qossmic\Deptrac\Contract\Config\CollectorType;
use Qossmic\Deptrac\Contract\Config\EmitterType;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (DeptracConfig $config, ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(IgnoreDependenciesOnContract::class)->tag('kernel.event_listener', ['event' => ProcessEvent::class]);
$services->set(IgnoreDependenciesOnShouldNotHappenException::class)->tag('kernel.event_listener', ['event' => ProcessEvent::class]);
$config->paths('src');
//$config->baseline('deptrac.baseline.yaml');
// analyser
$config->analyser(
EmitterType::CLASS_TOKEN,
EmitterType::CLASS_SUPERGLOBAL_TOKEN,
EmitterType::FILE_TOKEN,
EmitterType::FUNCTION_TOKEN,
EmitterType::FUNCTION_SUPERGLOBAL_TOKEN,
EmitterType::FUNCTION_CALL,
);
// layer
$analyser = $config->layer('Analyser');
$analyser->collector(CollectorType::TYPE_DIRECTORY)->value('src/Core/Analyser/.*');
$ast = $config->layer('Ast');
$ast->collector(CollectorType::TYPE_DIRECTORY)->value('src/Core/Ast/.*');
$ast->collector(CollectorType::TYPE_CLASS_NAME)->value('^PHPStan\\\\PhpDocParser\\\\.*')->private();
$ast->collector(CollectorType::TYPE_CLASS_NAME)->value('^PhpParser\\\\.*')->private();
$ast->collector(CollectorType::TYPE_CLASS_NAME)->value('^phpDocumentor\\\\Reflection\\\\.*')->private();
$console = $config->layer('Console');
$console->collector(CollectorType::TYPE_DIRECTORY)->value('src/Supportive/Console/.*');
$dependency = $config->layer('Dependency');
$dependency->collector(CollectorType::TYPE_DIRECTORY)->value('src/Core/Dependency/.*');
$dependencyInjection = $config->layer('DependencyInjection');
$dependencyInjection->collector(CollectorType::TYPE_DIRECTORY)->value('src/Supportive/DependencyInjection/.*');
$contract = $config->layer('Contract');
$contract->collector(CollectorType::TYPE_DIRECTORY)->value('src/Contract/.*');
$inputCollector = $config->layer('InputCollector');
$inputCollector->collector(CollectorType::TYPE_DIRECTORY)->value('src/Core/InputCollector/.*');
$layer = $config->layer('Layer');
$layer->collector(CollectorType::TYPE_DIRECTORY)->value('src/Core/Layer/.*');
$outputFormatter = $config->layer('OutputFormatter');
$outputFormatter->collector(CollectorType::TYPE_DIRECTORY)->value('src/Supportive/OutputFormatter/.*');
$outputFormatter->collector(CollectorType::TYPE_CLASS_NAME)->value('^phpDocumentor\\\\GraphViz\\\\.*')->private();
$file = $config->layer('File');
$file->collector(CollectorType::TYPE_DIRECTORY)->value('src/Supportive/File/.*');
$supportive = $config->layer('Supportive');
$supportiveCollector = $supportive->collector(CollectorType::TYPE_BOOL);
$supportiveCollector->mustNot(CollectorType::TYPE_DIRECTORY)->value('src/Supportive/.*/.*');
$supportiveCollector->must(CollectorType::TYPE_DIRECTORY)->value('src/Supportive/.*');
// ruleset
$config->ruleset($layer)->accessesLayer($ast);
$config->ruleset($console)->accessesLayer($analyser, $outputFormatter, $dependencyInjection, $file);
$config->ruleset($dependency)->accessesLayer($ast);
$config->ruleset($analyser)->accessesLayer($layer, $dependency, $ast);
$config->ruleset($outputFormatter)->accessesLayer($console, $dependencyInjection);
$config->ruleset($ast)->accessesLayer($file, $inputCollector);
$config->ruleset($inputCollector)->accessesLayer($file);
|
I like the first option. It is way more readable to me. 2 ideas I have just from looking at it:
|
The functions layers and rulesets just add Objects to an array, so there is no problem if you like to call them multiple times.
To solve this problem I copied the escaping logic from the Symfony yaml component into the function |
a33c585
to
235d989
Compare
@dbrumann, @patrickkusebauch did you guys also forgot, that we won't get autocompletion from the classes inside our Maybe we should work on #916 first ;-), our bundle the |
effcb98
to
e6042b3
Compare
I really like the current state. The PHP config is easy to read and thanks to the builders we can have some nice DX features like auto-escaping the regex. 👍 Gennadi and I discussed this PR on Friday. We decided that this should be an optional, experimental feature in the current major version. This will allow us to try this out first, adjust things based on early feedback, and then switch from YAML to PHP as default with one of the upcoming major versions. We will keep YAML around for anyone who doesn't want to change their configs for as long as both config formats can stay interchangeable. However, we will not maintain docs for both config formats. |
3558b0b
to
498216a
Compare
@gennadigennadigennadi is this one ready for review? |
Yes, please have a look. I'll have to rebase, but otherwise it's ready for review. But even if we merge it, it's not production ready. As mentioned by @dbrumann it this experimental. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions about what is being done, but otherwise very happy about it.
|
||
abstract class ConfigurableCollectorConfig extends CollectorConfig | ||
{ | ||
private const ESCAPEES = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a key->value array instead of 2 lists? It would make it IMHO more readable and less prone to error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This data is borrowed from symfony and I don't really know what all codes do. So wouldn't change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are just replacing the found instances of ESCAPEES
with ESCAPED
at the same position in the array. If it was just one key->value array you would just change it to str_replace(array_keys(self::ARRAY), array_values(self::ARRAY), $regex)
. That would be more readable to me. Not a blocker though.
and cleanup yaml version
enforce container to load php config
4f16e01
to
30d4d9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for taking so long and thanks for all the work. I really like the result 👍
Just wanted to say thank you for implementing this feature. The config builder will simplify by a lot the dynamic configuration which I am currently using in my project. 👌 🥳 🎉 |
Could I ask someone to publish new releases? Last available versions are 1.0.2 for all distributions from December. |
That would be an ask on @dbrumann . I do not have the privilege to publish a release. |
Yes, I am planning on a new release for a while. I want to investigate some issues first, but hopefully in 1-2 weeks there will be a 2.0 release |
Still no release with this feature :( |
I'm trying to find some time to work on the next release, but I have to understand how we sign those .phar with gpg for phive. Also I have to re-read our documentation/upgrade-infos, because the next release will be version v2. Maybe I will publish a release with the tag @ostrolucky and please remember that the configbuilder is still an experimental feature! |
@gennadigennadigennadi If we are to release a new Major version (even as a beta/rc), I would like to see:
I can do both this weekend if there is demand. |
Actually, one more thing. Closing #1243 before a major release would also be nice. Otherwise, we potentially will carry a huge burden for the next major release line. |
You did, but another quick review would be awesome!
I really like this idea! I'll have to add this to the release notes.
I don't now if this is doable (right now), becaue it would be necessary to sunset For me, one of the biggest annoyances is this one: #1287 and i would like to get this solved sooner than later. |
I don't have a vested interest in which distribution method we choose. I just want to have only one, so that we don't have the burden of all the build processes and incompatibilities between them (like writing extensions does not work everywhere). I personally use the direct |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [qossmic/deptrac](https://togithub.com/qossmic/deptrac) | `^2.0.0-alpha` -> `^2.0.0` | [![age](https://developer.mend.io/api/mc/badges/age/packagist/qossmic%2fdeptrac/2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/packagist/qossmic%2fdeptrac/2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/packagist/qossmic%2fdeptrac/2.0.0-alpha/2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/qossmic%2fdeptrac/2.0.0-alpha/2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>qossmic/deptrac (qossmic/deptrac)</summary> ### [`v2.0.0`](https://togithub.com/qossmic/deptrac/releases/tag/2.0.0) [Compare Source](https://togithub.com/qossmic/deptrac/compare/2.0.0-alpha...2.0.0) #### What's Changed - Bundle open dependency updates together by [@​dbrumann](https://togithub.com/dbrumann) in [https:/qossmic/deptrac/pull/1070](https://togithub.com/qossmic/deptrac/pull/1070) - Exception clean up by [@​patrickkusebauch](https://togithub.com/patrickkusebauch) in [https:/qossmic/deptrac/pull/1079](https://togithub.com/qossmic/deptrac/pull/1079) - Extension documentation by [@​patrickkusebauch](https://togithub.com/patrickkusebauch) in [https:/qossmic/deptrac/pull/867](https://togithub.com/qossmic/deptrac/pull/867) - Installation guide improved and aligned. by [@​d4s6](https://togithub.com/d4s6) in [https:/qossmic/deptrac/pull/1076](https://togithub.com/qossmic/deptrac/pull/1076) - Bump phpunit/phpunit from 9.5.27 to 9.5.28 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1080](https://togithub.com/qossmic/deptrac/pull/1080) - Bump phpstan/phpstan-symfony from 1.2.19 to 1.2.20 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1081](https://togithub.com/qossmic/deptrac/pull/1081) - Bump phpstan/phpstan from 1.9.11 to 1.9.13 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1083](https://togithub.com/qossmic/deptrac/pull/1083) - Use getOption instead getParameterOption on config file by [@​maciejkosiarski](https://togithub.com/maciejkosiarski) in [https:/qossmic/deptrac/pull/1089](https://togithub.com/qossmic/deptrac/pull/1089) - Fix --help doesn't work if deptrac.yaml file is missing issue by [@​maciejkosiarski](https://togithub.com/maciejkosiarski) in [https:/qossmic/deptrac/pull/1088](https://togithub.com/qossmic/deptrac/pull/1088) - Mutation coverage improvements by [@​patrickkusebauch](https://togithub.com/patrickkusebauch) in [https:/qossmic/deptrac/pull/1090](https://togithub.com/qossmic/deptrac/pull/1090) - Override --help input option and add throws annotation according to psalm audit by [@​maciejkosiarski](https://togithub.com/maciejkosiarski) in [https:/qossmic/deptrac/pull/1092](https://togithub.com/qossmic/deptrac/pull/1092) - Bump phpstan/phpstan from 1.9.13 to 1.9.17 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1111](https://togithub.com/qossmic/deptrac/pull/1111) - Bump phpstan/phpdoc-parser from 1.15.3 to 1.16.1 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1110](https://togithub.com/qossmic/deptrac/pull/1110) - Bump friendsofphp/php-cs-fixer from 3.13.2 to 3.14.4 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1109](https://togithub.com/qossmic/deptrac/pull/1109) - Bump phpunit/phpunit from 9.5.28 to 9.6.3 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1107](https://togithub.com/qossmic/deptrac/pull/1107) - Bump symfony/dependency-injection from 6.2.3 to 6.2.6 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1108](https://togithub.com/qossmic/deptrac/pull/1108) - Bump phpstan/phpstan-symfony from 1.2.20 to 1.2.23 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1106](https://togithub.com/qossmic/deptrac/pull/1106) - Bump symfony/finder from 6.2.3 to 6.2.5 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1093](https://togithub.com/qossmic/deptrac/pull/1093) - Bump symfony/console from 6.2.3 to 6.2.5 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1101](https://togithub.com/qossmic/deptrac/pull/1101) - Bump symfony/filesystem from 6.2.0 to 6.2.5 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1100](https://togithub.com/qossmic/deptrac/pull/1100) - Bump symfony/yaml from 6.2.2 to 6.2.5 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1099](https://togithub.com/qossmic/deptrac/pull/1099) - Bump symfony/event-dispatcher from 6.2.2 to 6.2.5 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1097](https://togithub.com/qossmic/deptrac/pull/1097) - Bump symfony/config from 6.2.0 to 6.2.5 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1095](https://togithub.com/qossmic/deptrac/pull/1095) - Bump symfony/options-resolver from 6.2.0 to 6.2.5 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1094](https://togithub.com/qossmic/deptrac/pull/1094) - Bump nikic/php-parser from 4.15.2 to 4.15.3 by [@​dependabot](https://togithub.com/dependabot) in [https:/qossmic/deptrac/pull/1087](https://togithub.com/qossmic/deptrac/pull/1087) - Updating Result generation by [@​patrickkusebauch](https://togithub.com/patrickkusebauch) in [https:/qossmic/deptrac/pull/1091](https://togithub.com/qossmic/deptrac/pull/1091) - Code hardening - solving baseline issues in SA tools by [@​patrickkusebauch](https://togithub.com/patrickkusebauch) in [https:/qossmic/deptrac/pull/1103](https://togithub.com/qossmic/deptrac/pull/1103) - \[rector] Prepare PHP 7.2 downgrade + scoped release with Rector by [@​TomasVotruba](https://togithub.com/TomasVotruba) in [https:/qossmic/deptrac/pull/1113](https://togithub.com/qossmic/deptrac/pull/1113) - Updated CollectorInterface namespace in docs by [@​ariddlestone](https://togithub.com/ariddlestone) in [https:/qossmic/deptrac/pull/1120](https://togithub.com/qossmic/deptrac/pull/1120) - Better Violations by [@​patrickkusebauch](https://togithub.com/patrickkusebauch) in [https:/qossmic/deptrac/pull/1105](https://togithub.com/qossmic/deptrac/pull/1105) - Update configuration.md typo by [@​gusdeboer](https://togithub.com/gusdeboer) in [https:/qossmic/deptrac/pull/1140](https://togithub.com/qossmic/deptrac/pull/1140) - Update dependencies by [@​dbrumann](https://togithub.com/dbrumann) in [https:/qossmic/deptrac/pull/1141](https://togithub.com/qossmic/deptrac/pull/1141) - Implement ConfigBuilder by [@​gennadigennadigennadi](https://togithub.com/gennadigennadigennadi) in [https:/qossmic/deptrac/pull/1002](https://togithub.com/qossmic/deptrac/pull/1002) - Add performance counters to ConsoleSubsriber by [@​rubenrubiob](https://togithub.com/rubenrubiob) in [https:/qossmic/deptrac/pull/1162](https://togithub.com/qossmic/deptrac/pull/1162) - Migrated `debug:unused` command from deptrac-awesome by [@​patrickkusebauch](https://togithub.com/patrickkusebauch) in [https:/qossmic/deptrac/pull/1164](https://togithub.com/qossmic/deptrac/pull/1164) - Migrated `debug:dependencies` command from deptrac-awesome by [@​patrickkusebauch](https://togithub.com/patrickkusebauch) in [https:/qossmic/deptrac/pull/1165](https://togithub.com/qossmic/deptrac/pull/1165) - Combine updates by [@​dbrumann](https://togithub.com/dbrumann) in [https:/qossmic/deptrac/pull/1171](https://togithub.com/qossmic/deptrac/pull/1171) - Sort make targets and introduce help by [@​dbrumann](https://togithub.com/dbrumann) in [https:/qossmic/deptrac/pull/1176](https://togithub.com/qossmic/deptrac/pull/1176) - Composer Collector by [@​patrickkusebauch](https://togithub.com/patrickkusebauch) in [https:/qossmic/deptrac/pull/1174](https://togithub.com/qossmic/deptrac/pull/1174) - PoC blog by [@​patrickkusebauch](https://togithub.com/patrickkusebauch) in [https:/qossmic/deptrac/pull/1178](https://togithub.com/qossmic/deptrac/pull/1178) - add docker setup and move cache-files into .cache/ by [@​gennadigennadigennadi](https://togithub.com/gennadigennadigennadi) in [https:/qossmic/deptrac/pull/1185](https://togithub.com/qossmic/deptrac/pull/1185) - [#​1158](https://togithub.com/qossmic/deptrac/issues/1158) - only read file once for filereader by [@​gennadigennadigennadi](https://togithub.com/gennadigennadigennadi) in [https:/qossmic/deptrac/pull/1192](https://togithub.com/qossmic/deptrac/pull/1192) - [#​1158](https://togithub.com/qossmic/deptrac/issues/1158) - only init new ComposerFileParser once per composer.lock by [@​gennadigennadigennadi](https://togithub.com/gennadigennadigennadi) in [https:/qossmic/deptrac/pull/1193](https://togithub.com/qossmic/deptrac/pull/1193) - Call `SuperGlobalToken::allowedNames()` just once by [@​staabm](https://togithub.com/staabm) in [https:/qossmic/deptrac/pull/1198](https://togithub.com/qossmic/deptrac/pull/1198) - Removing deprecations and other clean-up for new Major release by [@​patrickkusebauch](https://togithub.com/patrickkusebauch) in [https:/qossmic/deptrac/pull/1175](https://togithub.com/qossmic/deptrac/pull/1175) - Bump composer dep by [@​gennadigennadigennadi](https://togithub.com/gennadigennadigennadi) in [https:/qossmic/deptrac/pull/1216](https://togithub.com/qossmic/deptrac/pull/1216) - add php-cs-fixer rule "single_line_empty_body" by [@​gennadigennadigennadi](https://togithub.com/gennadigennadigennadi) in [https:/qossmic/deptrac/pull/1217](https://togithub.com/qossmic/deptrac/pull/1217) - Closes [https:/qossmic/deptrac/issues/1191](https://togithub.com/qossmic/deptrac/issues/1191) by [@​patrickkusebauch](https://togithub.com/patrickkusebauch) in [https:/qossmic/deptrac/pull/1204](https://togithub.com/qossmic/deptrac/pull/1204) - fix [#​1226](https://togithub.com/qossmic/deptrac/issues/1226) - skipped multiple violations in one file by [@​gennadigennadigennadi](https://togithub.com/gennadigennadigennadi) in [https:/qossmic/deptrac/pull/1227](https://togithub.com/qossmic/deptrac/pull/1227) - "deptrac" as composer bin by [@​gennadigennadigennadi](https://togithub.com/gennadigennadigennadi) in [https:/qossmic/deptrac/pull/1238](https://togithub.com/qossmic/deptrac/pull/1238) - do not crash the GraphViz formatter if no config is given by [@​xabbuh](https://togithub.com/xabbuh) in [https:/qossmic/deptrac/pull/1251](https://togithub.com/qossmic/deptrac/pull/1251) - Dev dependencies upgrade (PHPUnit & Psalm) by [@​patrickkusebauch](https://togithub.com/patrickkusebauch) in [https:/qossmic/deptrac/pull/1252](https://togithub.com/qossmic/deptrac/pull/1252) - Docs: exclude_files also works on directories by [@​staabm](https://togithub.com/staabm) in [https:/qossmic/deptrac/pull/1262](https://togithub.com/qossmic/deptrac/pull/1262) - Prevent excessive php-doc parsing in FileReferenceVisitor by [@​staabm](https://togithub.com/staabm) in [https:/qossmic/deptrac/pull/1199](https://togithub.com/qossmic/deptrac/pull/1199) - Composer collector exception when package does not exist by [@​maciejkosiarski](https://togithub.com/maciejkosiarski) in [https:/qossmic/deptrac/pull/1279](https://togithub.com/qossmic/deptrac/pull/1279) - Update dep by [@​gennadigennadigennadi](https://togithub.com/gennadigennadigennadi) in [https:/qossmic/deptrac/pull/1280](https://togithub.com/qossmic/deptrac/pull/1280) - Fix typo in the docs by [@​jdreesen](https://togithub.com/jdreesen) in [https:/qossmic/deptrac/pull/1281](https://togithub.com/qossmic/deptrac/pull/1281) - Add creating of cache directory if not exists by [@​alexander-schranz](https://togithub.com/alexander-schranz) in [https:/qossmic/deptrac/pull/1302](https://togithub.com/qossmic/deptrac/pull/1302) - Remove dollar signs from readme.md console examples by [@​that-guy-iain](https://togithub.com/that-guy-iain) in [https:/qossmic/deptrac/pull/1325](https://togithub.com/qossmic/deptrac/pull/1325) - Bump PHP Parser version to support PHP 8.3 by [@​benr77](https://togithub.com/benr77) in [https:/qossmic/deptrac/pull/1342](https://togithub.com/qossmic/deptrac/pull/1342) - bump composer.lock by [@​gennadigennadigennadi](https://togithub.com/gennadigennadigennadi) in [https:/qossmic/deptrac/pull/1344](https://togithub.com/qossmic/deptrac/pull/1344) - WIP: test scoped release by [@​gennadigennadigennadi](https://togithub.com/gennadigennadigennadi) in [https:/qossmic/deptrac/pull/1352](https://togithub.com/qossmic/deptrac/pull/1352) - update by [@​gennadigennadigennadi](https://togithub.com/gennadigennadigennadi) in [https:/qossmic/deptrac/pull/1406](https://togithub.com/qossmic/deptrac/pull/1406) #### New Contributors - [@​d4s6](https://togithub.com/d4s6) made their first contribution in [https:/qossmic/deptrac/pull/1076](https://togithub.com/qossmic/deptrac/pull/1076) - [@​maciejkosiarski](https://togithub.com/maciejkosiarski) made their first contribution in [https:/qossmic/deptrac/pull/1089](https://togithub.com/qossmic/deptrac/pull/1089) - [@​TomasVotruba](https://togithub.com/TomasVotruba) made their first contribution in [https:/qossmic/deptrac/pull/1113](https://togithub.com/qossmic/deptrac/pull/1113) - [@​ariddlestone](https://togithub.com/ariddlestone) made their first contribution in [https:/qossmic/deptrac/pull/1120](https://togithub.com/qossmic/deptrac/pull/1120) - [@​gusdeboer](https://togithub.com/gusdeboer) made their first contribution in [https:/qossmic/deptrac/pull/1140](https://togithub.com/qossmic/deptrac/pull/1140) - [@​rubenrubiob](https://togithub.com/rubenrubiob) made their first contribution in [https:/qossmic/deptrac/pull/1162](https://togithub.com/qossmic/deptrac/pull/1162) - [@​jdreesen](https://togithub.com/jdreesen) made their first contribution in [https:/qossmic/deptrac/pull/1281](https://togithub.com/qossmic/deptrac/pull/1281) - [@​alexander-schranz](https://togithub.com/alexander-schranz) made their first contribution in [https:/qossmic/deptrac/pull/1302](https://togithub.com/qossmic/deptrac/pull/1302) - [@​that-guy-iain](https://togithub.com/that-guy-iain) made their first contribution in [https:/qossmic/deptrac/pull/1325](https://togithub.com/qossmic/deptrac/pull/1325) - [@​benr77](https://togithub.com/benr77) made their first contribution in [https:/qossmic/deptrac/pull/1342](https://togithub.com/qossmic/deptrac/pull/1342) **Full Changelog**: qossmic/deptrac@1.0.2...2.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/Lendable/aggregate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Is this feature available in v2? I see it in main branch but it doesn't seem to be working with the new v2 version. |
To use the php config you have to explicitly call deptrac with the config-file param set to your php config. right now there is no fallback behavior implemented to automatically use the php config. |
I did it but I had an exception using the example in this PR.
It does work using return static function (DeptracConfig $config): void {
// ...
} That's such a great feature 🎉 |
The example with the containerConfigurator breaks because the internal Deptrac dependencies get scoped, it works in the example because that’s before it got scoped. |
First impression is that the current Configuration is a bit off, at least for the auto generated configbuilders