5
5
PHP coding standard used in [ Alma Career Czechia] ( https://www.almacareer.com/ ) (formerly LMC) products.
6
6
7
7
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.
9
9
10
10
We use [ EasyCodingStandard] to define and execute checks created for both [ PHP-CS-Fixer] and [ PHP_CodeSniffer] .
11
11
@@ -33,7 +33,7 @@ return ECSConfig::configure()
33
33
]
34
34
);
35
35
36
- // Be default only checks compatible with PHP 8.0 are enabled.
36
+ // By default, only checks compatible with PHP 8.0 are enabled.
37
37
// Depending on the lowest PHP version your project needs to support, you can enable additional checks.
38
38
39
39
// 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
74
74
On top of default code-style rules you are free to add any rules from [ PHP-CS-Fixer] or [ PHP_CodeSniffer] .
75
75
If needed, you can also override some default settings.
76
76
77
- Be aware you must add these settings ** after** import of the base Alma Career Czechia (LMC) code-style:
78
-
79
77
``` php
80
78
<?php declare(strict_types=1);
81
79
@@ -102,9 +100,7 @@ See [EasyCodingStandard docs](https://github.com/symplify/easy-coding-standard#c
102
100
103
101
### Exclude (skip) checks or files
104
102
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.
108
104
109
105
``` php
110
106
<?php declare(strict_types=1);
@@ -115,21 +111,18 @@ use Symplify\EasyCodingStandard\Config\ECSConfig;
115
111
116
112
return ECSConfig::configure()
117
113
/* (...) */
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(
129
115
[
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/*',
131
124
]
132
- );
125
+ )
133
126
/* (...) */
134
127
```
135
128
@@ -140,7 +133,7 @@ See [EasyCodingStandard docs](https://github.com/symplify/easy-coding-standard#c
140
133
For integration with PHPStorm etc. follow instructions in EasyCodingStandard [ README] ( https://github.com/symplify/easy-coding-standard#your-ide-integration ) .
141
134
142
135
## 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/ ) .
144
137
145
138
## License
146
139
This library is open source software licensed under the [ MIT license] ( LICENSE.md ) .
0 commit comments