-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathphparkitect.php
More file actions
21 lines (17 loc) · 805 Bytes
/
Copy pathphparkitect.php
File metadata and controls
21 lines (17 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
declare(strict_types=1);
use Architecture\FlatClassSet;
use Architecture\Expression\ForClasses\HaveNameMatchingRegEx;
use Arkitect\CLI\Config;
use Arkitect\Expression\ForClasses\ResideInOneOfTheseNamespaces;
use Arkitect\Rules\Rule;
return static function (Config $config): void {
$moduleRootClassset = FlatClassSet::fromDir(__DIR__.'/src/ForecastAutomation')
->excludePath('Kernel');
$moduleRootRule = Rule::allClasses()
->that(new ResideInOneOfTheseNamespaces('ForecastAutomation'))
->should(new HaveNameMatchingRegEx('/.*(DependencyProvider|Facade|Factory|Config)$/'))
->because('we want that application modules only depend on given patterns to ensure correct intermodality.');
$config
->add($moduleRootClassset, ...[$moduleRootRule]);
};