-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path.php-cs-fixer.dist.php
More file actions
76 lines (69 loc) · 2.46 KB
/
.php-cs-fixer.dist.php
File metadata and controls
76 lines (69 loc) · 2.46 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
declare(strict_types=1);
/**
* Copyright (c) 2020-2026 guanguans<ityaozm@gmail.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*
* @see https://github.com/guanguans/laravel-soar
*/
use Ergebnis\License\Holder;
use Ergebnis\License\Range;
use Ergebnis\License\Type\MIT;
use Ergebnis\License\Url;
use Ergebnis\License\Year;
use Ergebnis\PhpCsFixer\Config\Factory;
use Ergebnis\PhpCsFixer\Config\Fixers;
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet\Php81;
use PhpCsFixer\Finder;
require __DIR__.'/vendor/autoload.php';
return Factory::fromRuleSet(Php81::create()
->withHeader(
(static function (): string {
$mit = MIT::text(
__DIR__.'/LICENSE',
Range::since(
Year::fromString('2020'),
new DateTimeZone('Asia/Shanghai'),
),
Holder::fromString('guanguans<ityaozm@gmail.com>'),
Url::fromString('https://github.com/guanguans/laravel-soar'),
);
$mit->save();
return $mit->header();
})()
)
->withCustomFixers(Fixers::fromFixers(... require __DIR__.'/vendor/guanguans/php-cs-fixer-custom-fixers/config/custom-fixers.php'))
->withRules(Rules::fromArray(require __DIR__.'/vendor/guanguans/php-cs-fixer-custom-fixers/config/custom-rules.php'))
->withRules(Rules::fromArray(require __DIR__.'/vendor/guanguans/php-cs-fixer-custom-fixers/config/rules.php'))
->withRules(Rules::fromArray([
'@autoPHPUnitMigration:risky' => true,
'final_public_method_for_abstract_class' => false,
])))
->setUsingCache(true)
->setCacheFile(\sprintf('%s/.build/php-cs-fixer/%s.cache', __DIR__, pathinfo(__FILE__, \PATHINFO_FILENAME)))
->setUnsupportedPhpVersionAllowed(true)
->setFinder(
Finder::create()
->in(__DIR__)
->exclude([
'Fixtures/',
'vendor-bin/',
])
->notPath([
// '/lang\/.*\.json$/',
])
->notName([
'/\.blade\.php$/',
])
->ignoreDotFiles(false)
->ignoreUnreadableDirs(false)
->ignoreVCS(true)
->ignoreVCSIgnored(true)
->append([
__DIR__.'/composer-bump',
__DIR__.'/rule-doc-generator',
])
);