Skip to content

Commit 09bc7ce

Browse files
committed
Adding working CS fixer
1 parent fe5e18c commit 09bc7ce

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"require-dev": {
2222
"phpunit/phpunit" : "^10.5",
2323
"scrutinizer/ocular": "~1.9",
24-
"squizlabs/php_codesniffer": "^3.10",
2524
"rector/rector": "^1.2",
26-
"phpstan/phpstan": "^1.11"
25+
"phpstan/phpstan": "^1.11",
26+
"symplify/easy-coding-standard": "^12.3"
2727
},
2828
"autoload": {
2929
"psr-4": {
@@ -38,7 +38,7 @@
3838
"scripts": {
3939
"test": "phpunit",
4040
"test-coverage": "phpdbg -qrr vendor/bin/phpunit",
41-
"cs": "phpcs --standard=psr2 src/",
41+
"cs": "vendor/bin/ecs --fix",
4242
"phpstan": "vendor/bin/phpstan analyse src tests -l 5"
4343
}
4444
}

ecs.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
6+
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
7+
use PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer;
8+
use Symplify\EasyCodingStandard\Config\ECSConfig;
9+
10+
return ECSConfig::configure()
11+
->withPaths([
12+
__DIR__ . '/examples',
13+
__DIR__ . '/src',
14+
__DIR__ . '/tests',
15+
])
16+
->withRootFiles()
17+
->withConfiguredRule(
18+
ArraySyntaxFixer::class,
19+
['syntax' => 'short']
20+
)
21+
->withRules([
22+
NoUnusedImportsFixer::class,
23+
ListSyntaxFixer::class,
24+
]);

0 commit comments

Comments
 (0)