forked from codeigniter4/shield
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructarmed.php
More file actions
33 lines (30 loc) · 1.17 KB
/
Copy pathstructarmed.php
File metadata and controls
33 lines (30 loc) · 1.17 KB
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
<?php
declare(strict_types=1);
use Boundwize\StructArmed\Architecture;
use Boundwize\StructArmed\Preset\Preset;
use Boundwize\StructArmed\Preset\Presets\Psr4Preset;
use Boundwize\StructArmed\Rule\Rules\Class_\MustBeFinalRule;
return Architecture::define()
->rule(
'tests.must_be_final',
new MustBeFinalRule(layer: 'tests'),
)
->skip([
Psr4Preset::CLASSES_MUST_MATCH_COMPOSER => [
__DIR__ . '/src/Database/Migrations',
],
])
->cacheDirectory(is_dir('/tmp') ? '/tmp/structarmed' : null)
->withPreset(Preset::PSR4())
->layer('tests', __DIR__ . '/tests')
->layerPattern('Model', '/^CodeIgniter\\\\Shield\\\\.*Model$/')
->layerPattern('Controller', '/^CodeIgniter\\\\Shield\\\\Controllers\\\\.*$/')
->layerPattern('Config', '/^CodeIgniter\\\\Shield\\\\Config\\\\.*$/', '/^.*Services$/')
->layerPattern('Entity', '/^CodeIgniter\\\\Shield\\\\Entities\\\\.*$/')
->layerPattern('Service', '/^.*Services$/')
->ruleset([
'Entity' => ['Config', 'Model', 'Service'],
'Config' => ['Model', 'Service'],
'Model' => ['Config', 'Entity', 'Service'],
'Service' => ['Config'],
]);