You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
use Deptrac\Deptrac\Contract\Config\Collector\BoolConfig;
use Deptrac\Deptrac\Contract\Config\Collector\ClassLikeConfig;
use Deptrac\Deptrac\Contract\Config\Collector\LayerConfig;
use Deptrac\Deptrac\Contract\Config\DeptracConfig;
use Deptrac\Deptrac\Contract\Config\Layer;
use Deptrac\Deptrac\Contract\Config\Ruleset;
return static function (DeptracConfig $config): void {
$config
->paths('./src')
->excludeFiles('#.*test.*#')
->layers(
$analyzePublic = Layer::withName('AnalyzePublic')->collectors(
ClassLikeConfig::create('Kartierung\\Analyze\\Exception\\.+'),
ClassLikeConfig::create('Kartierung\\Analyze\\Result\\.+')
),
$analyze = Layer::withName('Analyze')->collectors(
BoolConfig::create(
must: [ClassLikeConfig::create('Kartierung\\Analyze\\.+')],
mustNot: [
LayerConfig::create($analyzePublic)
]
)
),
$attribute = Layer::withName('Attribute')->collectors(
ClassLikeConfig::create('Kartierung\\Attribute\\.*'),
),
)
->rulesets(
Ruleset::forLayer($analyze)
->accesses($attribute)
->accesses($analyzePublic),
);
};