Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a7f4d5c

Browse files
authored
Merge branch 'master' into fix_NoUnreachableDefaultArgumentValueFixer
2 parents 92b5d47 + 9654527 commit a7f4d5c

56 files changed

Lines changed: 531 additions & 223 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ jobs:
144144
php-version: '8.3'
145145
job-description: 'tests on macOS'
146146
run-tests: 'yes'
147+
AVOID_PARAUNIT: 'yes' # macOS job is having weird issue on CI under ParaUnit
147148
FAST_LINT_TEST_CASES: 1 # we need full syntax check on one job at least, no need to do it on additional
148149

149150
- operating-system: 'ubuntu-24.04'
@@ -226,8 +227,15 @@ jobs:
226227
composer require --dev --with-all-dependencies phpunit/phpunit:^12.0.2
227228
php php-cs-fixer fix --quiet --rules=php_unit_attributes
228229
229-
- name: Run tests
230-
if: matrix.run-tests == 'yes' && matrix.collect-code-coverage != 'yes'
230+
- name: Run tests (via PHPUnit)
231+
if: matrix.run-tests == 'yes' && matrix.collect-code-coverage != 'yes' && matrix.AVOID_PARAUNIT == 'yes'
232+
env:
233+
PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.PHP_CS_FIXER_IGNORE_ENV }}
234+
FAST_LINT_TEST_CASES: ${{ matrix.FAST_LINT_TEST_CASES }}
235+
run: vendor/bin/phpunit --testsuite unit,integration
236+
237+
- name: Run tests (via ParaUnit)
238+
if: matrix.run-tests == 'yes' && matrix.collect-code-coverage != 'yes' && matrix.AVOID_PARAUNIT != 'yes'
231239
env:
232240
PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.PHP_CS_FIXER_IGNORE_ENV }}
233241
FAST_LINT_TEST_CASES: ${{ matrix.FAST_LINT_TEST_CASES }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/.env
22
/.php-cs-fixer.php
3-
/.phpunit.result.cache
43
/box.json
54
/compose.override.yaml
65
/composer.lock
76
/dev-tools/bin/
87
/dev-tools/infection/
98
/dev-tools/php-compatibility/cache.json
109
/dev-tools/phpstan/cache/
10+
/dev-tools/phpunit/cache/
1111
/dev-tools/vendor/
1212
/infection.json5
1313
/php-cs-fixer.phar

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,25 @@ CHANGELOG for PHP CS Fixer
33

44
This file contains changelogs for stable releases only.
55

6+
Changelog for v3.73.1
7+
---------------------
8+
9+
* fix: `OrderedClassElementsFixer` - do not crash on property hook (#8517)
10+
11+
Changelog for v3.73.0
12+
---------------------
13+
14+
* feat: add support for asymmetric visibility to Doctrine's fixers (#8415)
15+
* fix: `GeneralPhpdocTagRenameFixer` - do not rename keys in array shape definition (#8477)
16+
* fix: `MethodArgumentSpaceFixer` - handle when nested in HTML (#8503)
17+
* chore: update `checkbashisms` to 2.25.5 (#8519)
18+
* DX: cleanup `NoExtraBlankLinesFixerTest` (#8505)
19+
* DX: for duplicated test methods check methods without parameters (#8508)
20+
* DX: remove more duplicated test methods (#8506)
21+
* refactor: `Tokenizer` hash metode using `xxHash` (#8491)
22+
* refactor: `TokensAnalyzerTest` - better test `isArray` and `isArrayMultiLine` (#8504)
23+
* test: run code coverage on PHP 8.4 (#8448)
24+
625
Changelog for v3.72.0
726
---------------------
827

dev-tools/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
"phpcompatibility/phpcompatibility-symfony": "^1.2.2",
1212
"phpmd/phpmd": "^2.15.0",
1313
"phpstan/extension-installer": "^1.4.3",
14-
"phpstan/phpstan": "^2.1.8",
14+
"phpstan/phpstan": "^2.1.9",
1515
"phpstan/phpstan-phpunit": "^2.0.4",
16-
"phpstan/phpstan-strict-rules": "^2.0.3",
17-
"phpstan/phpstan-symfony": "^2.0.2"
16+
"phpstan/phpstan-strict-rules": "^2.0.4",
17+
"phpstan/phpstan-symfony": "^2.0.3"
1818
},
1919
"config": {
2020
"allow-plugins": {

dev-tools/composer.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev-tools/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ cd "$(dirname "$0")"
1919

2020
mkdir -p bin
2121

22-
VERSION_CB="2.25.2"
22+
VERSION_CB="2.25.5"
2323
VERSION_SC="stable"
2424

2525
echo λλλ checkbashisms

dev-tools/phpstan/baseline.php

Lines changed: 1 addition & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@
848848
'path' => __DIR__ . '/../../src/Fixer/ClassNotation/NoPhp4ConstructorFixer.php',
849849
];
850850
$ignoreErrors[] = [
851-
'message' => '#^Method PhpCsFixer\\\\Fixer\\\\ClassNotation\\\\NoPhp4ConstructorFixer\\:\\:getWrapperMethodSequence\\(\\) should return array\\{list\\<list\\<array\\{int, string\\}\\|int\\|string\\>\\>, array\\{3\\: false\\}\\} but returns array\\{list\\<non\\-empty\\-list\\<\'\\(\'\\|\'\\)\'\\|\',\'\\|\';\'\\|\'\\{\'\\|\'\\}\'\\|array\\{0\\: int, 1\\?\\: string\\}\\>\\>, array\\{3\\: false\\}\\}\\.$#',
851+
'message' => '#^Method PhpCsFixer\\\\Fixer\\\\ClassNotation\\\\NoPhp4ConstructorFixer\\:\\:getWrapperMethodSequence\\(\\) should return array\\{list\\<list\\<array\\{int, string\\}\\|int\\|string\\>\\>, array\\{3\\: false\\}\\} but returns array\\{list\\<non\\-empty\\-list\\<array\\{0\\: int, 1\\?\\: string\\}\\|\\(literal\\-string&non\\-falsy\\-string\\)\\>\\>, array\\{3\\: false\\}\\}\\.$#',
852852
'identifier' => 'return.type',
853853
'count' => 1,
854854
'path' => __DIR__ . '/../../src/Fixer/ClassNotation/NoPhp4ConstructorFixer.php',
@@ -961,12 +961,6 @@
961961
'count' => 1,
962962
'path' => __DIR__ . '/../../src/Fixer/ClassNotation/OrderedClassElementsFixer.php',
963963
];
964-
$ignoreErrors[] = [
965-
'message' => '#^Offset int\\<0, max\\> might not exist on non\\-empty\\-list\\<array\\{start\\: int, visibility\\: string, abstract\\: bool, static\\: bool, readonly\\: bool, type\\: string, name\\: string, end\\: int\\}\\>\\.$#',
966-
'identifier' => 'offsetAccess.notFound',
967-
'count' => 1,
968-
'path' => __DIR__ . '/../../src/Fixer/ClassNotation/OrderedClassElementsFixer.php',
969-
];
970964
$ignoreErrors[] = [
971965
'message' => '#^Offset mixed might not exist on array\\<string, int\\>\\.$#',
972966
'identifier' => 'offsetAccess.notFound',
@@ -1099,12 +1093,6 @@
10991093
'count' => 2,
11001094
'path' => __DIR__ . '/../../src/Fixer/FunctionNotation/CombineNestedDirnameFixer.php',
11011095
];
1102-
$ignoreErrors[] = [
1103-
'message' => '#^Offset int might not exist on non\\-empty\\-array\\<int, int\\>\\.$#',
1104-
'identifier' => 'offsetAccess.notFound',
1105-
'count' => 1,
1106-
'path' => __DIR__ . '/../../src/Fixer/FunctionNotation/DateTimeCreateFromFormatCallFixer.php',
1107-
];
11081096
$ignoreErrors[] = [
11091097
'message' => '#^Method PhpCsFixer\\\\Fixer\\\\FunctionNotation\\\\ImplodeCallFixer\\:\\:getArgumentIndices\\(\\) should return array\\<int, int\\> but returns array\\<int\\|string, int\\|null\\>\\.$#',
11101098
'identifier' => 'return.type',
@@ -1159,12 +1147,6 @@
11591147
'count' => 1,
11601148
'path' => __DIR__ . '/../../src/Fixer/Import/GlobalNamespaceImportFixer.php',
11611149
];
1162-
$ignoreErrors[] = [
1163-
'message' => '#^Offset int might not exist on non\\-empty\\-array\\<int, PhpCsFixer\\\\DocBlock\\\\DocBlock\\>\\.$#',
1164-
'identifier' => 'offsetAccess.notFound',
1165-
'count' => 1,
1166-
'path' => __DIR__ . '/../../src/Fixer/Import/GlobalNamespaceImportFixer.php',
1167-
];
11681150
$ignoreErrors[] = [
11691151
'message' => '#^Parameter \\#1 \\$types of method PhpCsFixer\\\\DocBlock\\\\Annotation\\:\\:setTypes\\(\\) expects list\\<string\\>, array\\<int\\<0, max\\>, string\\> given\\.$#',
11701152
'identifier' => 'argument.type',
@@ -1501,12 +1483,6 @@
15011483
'count' => 1,
15021484
'path' => __DIR__ . '/../../src/Fixer/PhpUnit/PhpUnitConstructFixer.php',
15031485
];
1504-
$ignoreErrors[] = [
1505-
'message' => '#^Offset int\\<0, max\\> might not exist on non\\-empty\\-list\\<array\\{start\\: int, visibility\\: string, abstract\\: bool, static\\: bool, readonly\\: bool, type\\: string, name\\: string, end\\: int\\}\\>\\.$#',
1506-
'identifier' => 'offsetAccess.notFound',
1507-
'count' => 1,
1508-
'path' => __DIR__ . '/../../src/Fixer/PhpUnit/PhpUnitDataProviderMethodOrderFixer.php',
1509-
];
15101486
$ignoreErrors[] = [
15111487
'message' => '#^Cannot call method isGivenKind\\(\\) on PhpCsFixer\\\\Tokenizer\\\\Token\\|false\\.$#',
15121488
'identifier' => 'method.nonObject',
@@ -2035,12 +2011,6 @@
20352011
'count' => 1,
20362012
'path' => __DIR__ . '/../../src/Linter/CachingLinter.php',
20372013
];
2038-
$ignoreErrors[] = [
2039-
'message' => '#^Method PhpCsFixer\\\\Preg\\:\\:replace\\(\\) should return string but returns list\\<string\\>\\|string\\.$#',
2040-
'identifier' => 'return.type',
2041-
'count' => 2,
2042-
'path' => __DIR__ . '/../../src/Preg.php',
2043-
];
20442014
$ignoreErrors[] = [
20452015
'message' => '#^Parameter \\#2 \\$offset of function substr expects int, int\\|false given\\.$#',
20462016
'identifier' => 'argument.type',
@@ -2149,24 +2119,12 @@
21492119
'count' => 3,
21502120
'path' => __DIR__ . '/../../src/Tokenizer/Analyzer/ControlCaseStructuresAnalyzer.php',
21512121
];
2152-
$ignoreErrors[] = [
2153-
'message' => '#^Offset int\\<0, max\\> might not exist on non\\-empty\\-array\\<int\\<0, max\\>, non\\-empty\\-array\\<literal\\-string&non\\-falsy\\-string, mixed\\>\\>\\.$#',
2154-
'identifier' => 'offsetAccess.notFound',
2155-
'count' => 6,
2156-
'path' => __DIR__ . '/../../src/Tokenizer/Analyzer/ControlCaseStructuresAnalyzer.php',
2157-
];
21582122
$ignoreErrors[] = [
21592123
'message' => '#^Parameter \\#1 \\$analysis of static method PhpCsFixer\\\\Tokenizer\\\\Analyzer\\\\ControlCaseStructuresAnalyzer\\:\\:buildControlCaseStructureAnalysis\\(\\) expects array\\{kind\\: int, index\\: int, open\\: int, end\\: int, cases\\: list\\<array\\{index\\: int, open\\: int\\}\\>, default\\: array\\{index\\: int, open\\: int\\}\\|null\\}, non\\-empty\\-array\\<literal\\-string&non\\-falsy\\-string, mixed\\> given\\.$#',
21602124
'identifier' => 'argument.type',
21612125
'count' => 2,
21622126
'path' => __DIR__ . '/../../src/Tokenizer/Analyzer/ControlCaseStructuresAnalyzer.php',
21632127
];
2164-
$ignoreErrors[] = [
2165-
'message' => '#^Offset non\\-empty\\-string might not exist on array\\<non\\-empty\\-string, list\\<int\\>\\>\\.$#',
2166-
'identifier' => 'offsetAccess.notFound',
2167-
'count' => 1,
2168-
'path' => __DIR__ . '/../../src/Tokenizer/Analyzer/SwitchAnalyzer.php',
2169-
];
21702128
$ignoreErrors[] = [
21712129
'message' => '#^Method PhpCsFixer\\\\Tokenizer\\\\Tokens\\:\\:findGivenKind\\(\\) should return array\\<int, array\\<int\\<0, max\\>, PhpCsFixer\\\\Tokenizer\\\\Token\\>\\|PhpCsFixer\\\\Tokenizer\\\\Token\\> but returns array\\<\'\'\\|int, array\\<int, PhpCsFixer\\\\Tokenizer\\\\Token\\>\\|PhpCsFixer\\\\Tokenizer\\\\Token\\>\\.$#',
21722130
'identifier' => 'return.type',
@@ -2203,12 +2161,6 @@
22032161
'count' => 1,
22042162
'path' => __DIR__ . '/../../src/Tokenizer/Tokens.php',
22052163
];
2206-
$ignoreErrors[] = [
2207-
'message' => '#^Offset int\\|string might not exist on non\\-empty\\-array\\<int\\|string, int\\<0, max\\>\\>\\.$#',
2208-
'identifier' => 'offsetAccess.notFound',
2209-
'count' => 1,
2210-
'path' => __DIR__ . '/../../src/Tokenizer/Tokens.php',
2211-
];
22122164
$ignoreErrors[] = [
22132165
'message' => '#^Offset non\\-empty\\-string might not exist on array\\<non\\-empty\\-string, PhpCsFixer\\\\Tokenizer\\\\Tokens\\>\\.$#',
22142166
'identifier' => 'offsetAccess.notFound',
@@ -2413,12 +2365,6 @@
24132365
'count' => 1,
24142366
'path' => __DIR__ . '/../../tests/AutoReview/ProjectCodeTest.php',
24152367
];
2416-
$ignoreErrors[] = [
2417-
'message' => '#^Offset class\\-string might not exist on array\\<class\\-string, PhpCsFixer\\\\Tokenizer\\\\Tokens\\>\\.$#',
2418-
'identifier' => 'offsetAccess.notFound',
2419-
'count' => 1,
2420-
'path' => __DIR__ . '/../../tests/AutoReview/ProjectCodeTest.php',
2421-
];
24222368
$ignoreErrors[] = [
24232369
'message' => '#^Offset int\\<0, max\\> might not exist on non\\-empty\\-list\\<ReflectionParameter\\>\\.$#',
24242370
'identifier' => 'offsetAccess.notFound',
@@ -2779,24 +2725,6 @@
27792725
'count' => 1,
27802726
'path' => __DIR__ . '/../../tests/FixerFactoryTest.php',
27812727
];
2782-
$ignoreErrors[] = [
2783-
'message' => '#^Parameter \\#1 \\$pattern of static method PhpCsFixer\\\\Preg\\:\\:replace\\(\\) expects string, list\\<string\\>\\|string given\\.$#',
2784-
'identifier' => 'argument.type',
2785-
'count' => 1,
2786-
'path' => __DIR__ . '/../../tests/PregTest.php',
2787-
];
2788-
$ignoreErrors[] = [
2789-
'message' => '#^Parameter \\#1 \\$pattern of static method PhpCsFixer\\\\Preg\\:\\:replaceCallback\\(\\) expects string, list\\<string\\>\\|string given\\.$#',
2790-
'identifier' => 'argument.type',
2791-
'count' => 1,
2792-
'path' => __DIR__ . '/../../tests/PregTest.php',
2793-
];
2794-
$ignoreErrors[] = [
2795-
'message' => '#^Parameter \\#3 \\$subject of static method PhpCsFixer\\\\Preg\\:\\:replaceCallback\\(\\) expects string, list\\<string\\>\\|string given\\.$#',
2796-
'identifier' => 'argument.type',
2797-
'count' => 1,
2798-
'path' => __DIR__ . '/../../tests/PregTest.php',
2799-
];
28002728
$ignoreErrors[] = [
28012729
'message' => '#^Offset string might not exist on array\\<string, PhpCsFixer\\\\Fixer\\\\FixerInterface\\>\\.$#',
28022730
'identifier' => 'offsetAccess.notFound',

doc/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ To integrate PHP CS Fixer as check into Gitlab-CI, you can use a configuration l
8787
php-cs-fixer:
8888
image: ghcr.io/php-cs-fixer/php-cs-fixer:${FIXER_VERSION:-3-php8.3}
8989
script:
90-
php-cs-fixer check --format gitlab
90+
php-cs-fixer check # --format gitlab ## specify format if not using PHP_CS_FIXER_FUTURE_MODE or v4+
9191
# use `check .` if your repository not having paths configured in .php-cs-fixer[.dist].php
9292
9393
Homebrew (globally)

doc/rules/basic/no_trailing_comma_in_singleline.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Which elements to fix.
1515

1616
Allowed values: a subset of ``['arguments', 'array', 'array_destructuring', 'group_import']``
1717

18-
Default value: ``['arguments', 'array_destructuring', 'array', 'group_import']``
18+
Default value: ``['arguments', 'array', 'array_destructuring', 'group_import']``
1919

2020
Examples
2121
--------

doc/rules/class_notation/visibility_required.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The structural elements to fix (PHP >= 7.1 required for ``const``).
1616

1717
Allowed values: a subset of ``['const', 'method', 'property']``
1818

19-
Default value: ``['property', 'method', 'const']``
19+
Default value: ``['const', 'method', 'property']``
2020

2121
Examples
2222
--------

0 commit comments

Comments
 (0)