This repository was archived by the owner on Mar 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +24
-3
lines changed Expand file tree Collapse file tree 4 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 6
6
7
7
## Unreleased
8
8
- Fix SpecifyArgSeparatorFixer not compatible with php-cs-fixer 3.0.
9
+ - Add new ` ecs-7.4.php ` coding standard declaration file for PHP 7.4+.
9
10
10
11
## 3.1.0 - 2021-05-13
11
12
- Use php-cs-fixer 3.0.
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
26
26
27
27
return static function (ContainerConfigurator $containerConfigurator): void {
28
28
$containerConfigurator->import(__DIR__ . '/vendor/lmc/coding-standard/ecs.php');
29
+
30
+ // If you only need PHP 7.4+ in your project, uncomment this to import additional checks:
31
+ //$containerConfigurator->import(__DIR__ . '/vendor/lmc/coding-standard/ecs-7.4.php');
29
32
};
30
33
```
31
34
Original file line number Diff line number Diff line change 49
49
" @test"
50
50
],
51
51
"analyze" : [
52
- " vendor/bin/ecs check src/ tests/ ecs.php --ansi" ,
52
+ " vendor/bin/ecs check src/ tests/ ecs.php ecs-7.4.php --ansi" ,
53
53
" vendor/bin/ecs check-markdown README.md --ansi" ,
54
54
" vendor/bin/phpstan analyze -c phpstan.neon --ansi"
55
55
],
56
56
"fix" : [
57
57
" @composer normalize" ,
58
- " vendor/bin/ecs check ./src/ ./tests/ ecs.php --ansi --fix"
58
+ " vendor/bin/ecs check ./src/ ./tests/ ecs.php ecs-7.4.php --ansi --fix"
59
59
],
60
60
"lint" : [
61
- " vendor/bin/parallel-lint -j 10 -e php ./src ./tests ecs.php" ,
61
+ " vendor/bin/parallel-lint -j 10 -e php ./src ./tests ecs.php ecs-7.4.php " ,
62
62
" @composer validate" ,
63
63
" @composer normalize --dry-run"
64
64
],
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ use PhpCsFixer \Fixer \FunctionNotation \PhpdocToParamTypeFixer ;
4
+ use PhpCsFixer \Fixer \FunctionNotation \PhpdocToPropertyTypeFixer ;
5
+ use PhpCsFixer \Fixer \FunctionNotation \PhpdocToReturnTypeFixer ;
6
+ use Symfony \Component \DependencyInjection \Loader \Configurator \ContainerConfigurator ;
7
+
8
+ return static function (ContainerConfigurator $ containerConfigurator ): void {
9
+ $ services = $ containerConfigurator ->services ();
10
+
11
+ // Takes `@var` annotation of non-mixed types and adjusts accordingly the property signature.
12
+ $ services ->set (PhpdocToPropertyTypeFixer::class);
13
+ // Takes `@param` annotations of non-mixed types and adjusts accordingly the function signature.
14
+ $ services ->set (PhpdocToParamTypeFixer::class);
15
+ // Takes `@return` annotation of non-mixed types and adjusts accordingly the function signature.
16
+ $ services ->set (PhpdocToReturnTypeFixer::class);
17
+ };
You can’t perform that action at this time.
0 commit comments