-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathphparkitect.php
More file actions
25 lines (19 loc) · 822 Bytes
/
phparkitect.php
File metadata and controls
25 lines (19 loc) · 822 Bytes
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
<?php
declare(strict_types=1);
use Arkitect\ClassSet;
use Arkitect\CLI\Config;
use Arkitect\Expression\ForClasses\Extend;
use Arkitect\Expression\ForClasses\HaveNameMatching;
use Arkitect\Expression\ForClasses\ResideInOneOfTheseNamespaces;
use Arkitect\Rules\Rule;
use Rector\Rector\AbstractRector;
return static function (Config $config): void {
$srcClassSet = ClassSet::fromDir(__DIR__ . '/src');
$rules = [];
$rectors = Rule::allClasses()->that(new ResideInOneOfTheseNamespaces('Codito\Rector\Money\Rule'));
$rules[] = $rectors->should(new HaveNameMatching('*Rector'))->because('this is Rector convention');
$rules[] = $rectors
->should(new Extend(AbstractRector::class))
->because('we need satisfy Rector\'s contract for rules');
$config->add($srcClassSet, ...$rules);
};