Skip to content

Commit 85d5ec6

Browse files
committed
Docs: Update readme to respect new ECS config behavior
1 parent 94afa27 commit 85d5ec6

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

README.md

+14-21
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
PHP coding standard used in [Alma Career Czechia](https://www.almacareer.com/) (formerly LMC) products.
66

77
Standard is based on [PSR-12](https://www.php-fig.org/psr/psr-12/) and adds
8-
various checks to make sure the code is readable, does follow the same conventions and does not contain common mistakes.
8+
various checks to make sure the code is readable, follows the same conventions, and does not contain common mistakes.
99

1010
We use [EasyCodingStandard] to define and execute checks created for both [PHP-CS-Fixer] and [PHP_CodeSniffer].
1111

@@ -33,7 +33,7 @@ return ECSConfig::configure()
3333
]
3434
);
3535

36-
// Be default only checks compatible with PHP 8.0 are enabled.
36+
// By default, only checks compatible with PHP 8.0 are enabled.
3737
// Depending on the lowest PHP version your project needs to support, you can enable additional checks.
3838

3939
// Import one of ecs-8.1.php, ecs-8.2.php or ecs-8.3.php. Use only one additional file (for the highest possible
@@ -74,8 +74,6 @@ Now you will be able to run the fix using `composer analyze` and execute automat
7474
On top of default code-style rules you are free to add any rules from [PHP-CS-Fixer] or [PHP_CodeSniffer].
7575
If needed, you can also override some default settings.
7676

77-
Be aware you must add these settings **after** import of the base Alma Career Czechia (LMC) code-style:
78-
7977
```php
8078
<?php declare(strict_types=1);
8179

@@ -102,9 +100,7 @@ See [EasyCodingStandard docs](https://github.com/symplify/easy-coding-standard#c
102100

103101
### Exclude (skip) checks or files
104102

105-
You can configure your `ecs.php` to entirely skip some files, disable specific checks of suppress specific errors.
106-
107-
Unlike adding/modifying checks, skips must be added **before** import of the base Alma Career Czechia (LMC) code-style.
103+
You can configure your `ecs.php` to entirely skip some files, disable specific checks or suppress specific errors.
108104

109105
```php
110106
<?php declare(strict_types=1);
@@ -115,21 +111,18 @@ use Symplify\EasyCodingStandard\Config\ECSConfig;
115111

116112
return ECSConfig::configure()
117113
/* (...) */
118-
->withSkip([
119-
// Ignore specific check only in specific files
120-
ForbiddenFunctionsSniff::class => [__DIR__ . '/src-tests/bootstrap.php'],
121-
// Disable check entirely
122-
ArrayDeclarationSniff::class,
123-
// Skip one file
124-
__DIR__ . '/file/to/be/skipped.php',
125-
// Skip entire directory
126-
__DIR__ . '/ignored/directory/*',
127-
])
128-
->withSets(
114+
->withSkip(
129115
[
130-
__DIR__ . '/vendor/lmc/coding-standard/ecs.php',
116+
// Ignore specific check only in specific files
117+
ForbiddenFunctionsSniff::class => [__DIR__ . '/src-tests/bootstrap.php'],
118+
// Disable check entirely
119+
ArrayDeclarationSniff::class,
120+
// Skip one file
121+
__DIR__ . '/file/to/be/skipped.php',
122+
// Skip entire directory
123+
__DIR__ . '/ignored/directory/*',
131124
]
132-
);
125+
)
133126
/* (...) */
134127
```
135128

@@ -140,7 +133,7 @@ See [EasyCodingStandard docs](https://github.com/symplify/easy-coding-standard#c
140133
For integration with PHPStorm etc. follow instructions in EasyCodingStandard [README](https://github.com/symplify/easy-coding-standard#your-ide-integration).
141134

142135
## Changelog
143-
For latest changes see [CHANGELOG.md](CHANGELOG.md) file. We follow [Semantic Versioning](https://semver.org/).
136+
For the latest changes see [CHANGELOG.md](CHANGELOG.md) file. We follow [Semantic Versioning](https://semver.org/).
144137

145138
## License
146139
This library is open source software licensed under the [MIT license](LICENSE.md).

0 commit comments

Comments
 (0)