Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 16 additions & 25 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,27 @@
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
use Webware\CodingStandard\WebwareCopyRight;
use Webware\CodingStandard\Webware1x0Set;

$year = date('Y');

$fileHeader = <<<HEADER
This file is part of Webware Coding Standard.

Copyright (c) {$year} Joey Smith <jsmith@webinertia.net>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
HEADER;

$ruleSet = require 'src/ruleset.php';
$composerData = json_decode(file_get_contents('composer.json'), true);

return (new Config())
->registerCustomRuleSets([
new WebwareCopyRight(
packageName: $composerData['name'],
authorName: $composerData['authors'][0]['name'],
authorEmail: $composerData['authors'][0]['email'],
minYear: '2026',
),
new Webware1x0Set(),
])
->setParallelConfig(ParallelConfigFactory::detect()) // @TODO 4.0 no need to call this manually
->setRiskyAllowed(true)
->setRules(
array_merge(
$ruleSet,
[
'header_comment' => [
'header' => $fileHeader,
'comment_type' => 'PHPDoc',
'location' => 'after_declare_strict',
'separate' => 'both',
],
]
)
)
->setRules([
'@Webware/copyright-header' => true,
'@Webware/coding-standard-1.0' => true,
])
// 💡 by default, Fixer looks for `*.php` files excluding `./vendor/` - here, you can groom this config
->setFinder(
(new Finder())
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"check": [
"@cs-check"
],
"cs-check": "vendor/bin/php-cs-fixer check",
"cs-check": "vendor/bin/php-cs-fixer check -v --show-progress=dots --using-cache=no",
"cs-fix": "vendor/bin/php-cs-fixer fix"
}
}
51 changes: 28 additions & 23 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading