Skip to content

Commit 560ad04

Browse files
committed
bump deps
1 parent 03329e0 commit 560ad04

File tree

6 files changed

+45
-259
lines changed

6 files changed

+45
-259
lines changed

README.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,45 @@
22

33
[![Downloads](https://img.shields.io/packagist/dt/symplify/coding-standard.svg?style=flat-square)](https://packagist.org/packages/symplify/coding-standard/stats)
44

5-
Set of rules for PHP_CodeSniffer and PHP-CS-Fixer used by Symplify projects.
5+
Coding standard rules for clean, consistent, and readable PHP code. No configuration needed—just install and let it handle the rest.
66

7-
**They run best with [EasyCodingStandard](https://github.com/symplify/easy-coding-standard)**.
7+
They run best with [ECS](https://github.com/symplify/easy-coding-standard).
88

99
<br>
1010

1111
## Install
1212

1313
```bash
1414
composer require symplify/coding-standard --dev
15-
composer require symplify/easy-coding-standard --dev
15+
composer require phpecs/phpecs --dev
1616
```
1717

18-
1. Run with [ECS](https://github.com/symplify/easy-coding-standard):
18+
1. Register in ECS config:
1919

20-
```diff
21-
# ecs.php
20+
```php
21+
# ecs.php
2222
use Symplify\EasyCodingStandard\Config\ECSConfig;
23-
+use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
23+
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
2424

25-
return static function (ECSConfig $ecsConfig): void {
26-
+ $ecsConfig->sets([SetList::SYMPLIFY]);
25+
return ECSConfig::configure()
26+
->withSets([SetList::SYMPLIFY]);
27+
```
28+
29+
30+
2. And run:
31+
32+
```bash
33+
# dry-run without changes
34+
vendor/bin/ecs
35+
36+
37+
# apply changes
38+
vendor/bin/ecs --fix
2739
```
2840

2941
<br>
3042

31-
<!-- ruledoc-start -->
32-
# 12 Rules Overview
43+
# 12 Rules to Keep Your Code Clean
3344

3445
## ArrayListItemNewlineFixer
3546

@@ -255,5 +266,3 @@ Promoted property should be on standalone line
255266
```
256267

257268
<br>
258-
259-
<!-- ruledoc-end -->

composer.json

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
"require": {
66
"php": ">=8.2",
77
"nette/utils": "^4.0",
8-
"friendsofphp/php-cs-fixer": "^3.59",
8+
"friendsofphp/php-cs-fixer": "^3.73.1",
99
"symplify/rule-doc-generator-contracts": "^11.2"
1010
},
1111
"require-dev": {
12-
"symplify/easy-coding-standard": "^12.3",
13-
"squizlabs/php_codesniffer": "^3.10.1",
14-
"phpunit/phpunit": "^10.5",
15-
"symplify/rule-doc-generator": "^12.2.2",
12+
"symplify/easy-coding-standard": "^12.5",
13+
"squizlabs/php_codesniffer": "^3.12",
14+
"phpunit/phpunit": "^11.0",
1615
"phpstan/extension-installer": "^1.4",
17-
"phpstan/phpstan": "^1.11",
18-
"rector/rector": "^1.1",
19-
"symplify/phpstan-extensions": "^11.4",
20-
"tomasvotruba/class-leak": "^0.2",
16+
"phpstan/phpstan": "^2.1",
17+
"rector/rector": "^2.0",
18+
"symplify/phpstan-extensions": "^12.0",
19+
"tomasvotruba/class-leak": "^2.0",
2120
"tracy/tracy": "^2.10"
2221
},
2322
"autoload": {
@@ -38,8 +37,7 @@
3837
"scripts": {
3938
"check-cs": "vendor/bin/ecs check --ansi",
4039
"fix-cs": "vendor/bin/ecs check --fix --ansi",
41-
"phpstan": "vendor/bin/phpstan analyse --ansi --error-format symplify",
42-
"rector": "vendor/bin/rector process --dry-run --ansi",
43-
"docs": "vendor/bin/rule-doc-generator generate src --readme --ansi"
40+
"phpstan": "vendor/bin/phpstan analyse --ansi",
41+
"rector": "vendor/bin/rector process --dry-run --ansi"
4442
}
4543
}

docs/rules_overview.md

Lines changed: 0 additions & 226 deletions
This file was deleted.

phpstan.neon

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
parameters:
22
level: 8
33

4+
errorFormat: symplify
5+
46
paths:
57
- src
68
- config
@@ -24,7 +26,7 @@ parameters:
2426
# unused generics
2527
- '#Class (.*?) implements generic interface PhpCsFixer\\Fixer\\ConfigurableFixerInterface but does not specify its types\: TFixerInputConfig, TFixerComputedConfig#'
2628

27-
# false positive
29+
# conditional check to allow various php versions
2830
-
29-
message: '#Parameter \#1 \$sequence of method PhpCsFixer\\Tokenizer\\Tokens\:\:findSequence\(\) expects non\-empty\-array<int, array\{0\: int, 1\?\: string\}\|PhpCsFixer\\Tokenizer\\Token\|string>, array<PhpCsFixer\\Tokenizer\\Token> given#'
30-
path: src/Fixer/Strict/BlankLineAfterStrictTypesFixer.php
31+
message: '#Comparison operation ">\=" between int<80200, 80499> and (.*?) is always true#'
32+
path: src/TokenAnalyzer/DocblockRelatedParamNamesResolver.php

src/Fixer/Strict/BlankLineAfterStrictTypesFixer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* Inspired at https://github.com/aidantwoods/PHP-CS-Fixer/tree/feature/DeclareStrictTypesFixer-split
2020
*
2121
* @thanks Aidan Woods
22+
*
2223
* @see \Symplify\CodingStandard\Tests\Fixer\Strict\BlankLineAfterStrictTypesFixer\BlankLineAfterStrictTypesFixerTest
2324
*/
2425
final class BlankLineAfterStrictTypesFixer extends AbstractSymplifyFixer implements DocumentedRuleInterface
@@ -31,9 +32,9 @@ final class BlankLineAfterStrictTypesFixer extends AbstractSymplifyFixer impleme
3132
/**
3233
* Generates: "declare(strict_types=1);"
3334
*
34-
* @var Token[]
35+
* @var non-empty-list<Token>
3536
*/
36-
private array $declareStrictTypeTokens = [];
37+
private array $declareStrictTypeTokens;
3738

3839
public function __construct(
3940
private readonly WhitespacesFixerConfig $whitespacesFixerConfig

src/TokenAnalyzer/DocblockRelatedParamNamesResolver.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,19 @@
1111
final class DocblockRelatedParamNamesResolver
1212
{
1313
/**
14-
* @var Token[]
14+
* @var list<Token>
1515
*/
16-
private array $functionTokens = [];
16+
private array $functionTokens;
1717

1818
private readonly FunctionsAnalyzer $functionsAnalyzer;
1919

2020
public function __construct(
2121
) {
2222
$this->functionsAnalyzer = new FunctionsAnalyzer();
2323

24-
$this->functionTokens[] = new Token([T_FUNCTION, 'function']);
24+
$this->functionTokens = [
25+
new Token([T_FUNCTION, 'function'])
26+
];
2527

2628
// only in PHP 7.4+
2729
if ($this->doesFnTokenExist()) {

0 commit comments

Comments
 (0)