forked from DomainDrivers/dd-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphparkitect.php
43 lines (36 loc) · 2.61 KB
/
phparkitect.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
declare(strict_types=1);
use Arkitect\ClassSet;
use Arkitect\CLI\Config;
use Arkitect\RuleBuilders\Architecture\Architecture;
return static function (Config $config): void {
$classSet = ClassSet::fromDir(__DIR__.'/src');
$layeredArchitectureRules = Architecture::withComponents()
->component('Availability')->definedBy('DomainDrivers\SmartSchedule\Planning\Availability\*')
->component('Allocation')->definedBy('DomainDrivers\SmartSchedule\Allocation\*')
->component('CapabilityScheduling')->definedBy('DomainDrivers\SmartSchedule\Allocation\CapabilityScheduling\*')
->component('CapabilityScheduling-Acl')->definedBy('DomainDrivers\SmartSchedule\Allocation\CapabilityScheduling\LegacyAcl\*')
->component('Cashflow')->definedBy('DomainDrivers\SmartSchedule\Allocation\Cashflow\*')
->component('Parallelization')->definedBy('DomainDrivers\SmartSchedule\Planning\Parallelization\*')
->component('Sorter')->definedBy('DomainDrivers\SmartSchedule\Sorter\*')
->component('Simulation')->definedBy('DomainDrivers\SmartSchedule\Simulation\*')
->component('Optimization')->definedBy('DomainDrivers\SmartSchedule\Optimization\*')
->component('Resource')->definedBy('DomainDrivers\SmartSchedule\Resource\*')
->component('Employee')->definedBy('DomainDrivers\SmartSchedule\Resource\Employee\*')
->component('Device')->definedBy('DomainDrivers\SmartSchedule\Resource\Device\*')
->component('Shared')->definedBy('DomainDrivers\SmartSchedule\Shared\*')
->where('Availability')->mayDependOnComponents('Shared')
->where('Allocation')->mayDependOnComponents('Shared', 'Availability', 'Cashflow', 'Simulation', 'Optimization', 'CapabilityScheduling', 'CapabilityScheduling-Acl')
->where('Parallelization')->mayDependOnComponents('Sorter', 'Shared', 'Availability')
->where('Sorter')->shouldNotDependOnAnyComponent()
->where('Simulation')->mayDependOnComponents('Optimization', 'Shared')
->where('Optimization')->mayDependOnComponents('Shared')
->where('Cashflow')->mayDependOnComponents('Allocation', 'Shared')
->where('CapabilityScheduling')->mayDependOnComponents('Availability', 'Allocation', 'Shared', 'CapabilityScheduling-Acl')
->where('Employee')->mayDependOnComponents('CapabilityScheduling', 'Allocation', 'Resource', 'Shared')
->where('Device')->mayDependOnComponents('CapabilityScheduling', 'Allocation', 'Resource', 'Shared')
->where('Shared')->shouldNotDependOnAnyComponent()
->rules();
$config
->add($classSet, ...$layeredArchitectureRules);
};