-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.php-cs-fixer.dist.php
More file actions
46 lines (41 loc) · 1.4 KB
/
.php-cs-fixer.dist.php
File metadata and controls
46 lines (41 loc) · 1.4 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
<?php declare(strict_types=1);
require_once __DIR__.'/vendor/autoload.php';
use IWF\CodingStandard\IWFRiskySet;
use IWF\CodingStandard\IWFSet;
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
$year = date('Y');
$header = <<<EOF
PHP Coding Standard
@package PHP Coding Standard
@author IWF Web Solutions <web-solutions@iwf.ch>
@copyright Copyright (c) 2025-{$year} IWF Web Solutions <web-solutions@iwf.ch>
@license https://github.com/iwf-web/php-coding-standard/blob/main/LICENSE.txt MIT License
@link https://github.com/iwf-web/php-coding-standard
EOF;
// https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/ruleSets/index.rst
// https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/rules/index.rst
return (new Config())
->registerCustomRuleSets([
new IWFSet(),
new IWFRiskySet(),
])
->setFinder(Finder::create()
->in(__DIR__)
->ignoreDotFiles(false)
->ignoreVCSIgnored(true)
->notPath('.php-cs-fixer.dist.php')
)
->setParallelConfig(ParallelConfigFactory::detect())
->setUnsupportedPhpVersionAllowed(true)
->setRiskyAllowed(true)
->setRules([
'@IWF/standard' => true,
'@IWF/standard:risky' => true,
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => $header,
],
])
;