From 3710972efab68f65efaa1cd6f58ab1a47ba980e2 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Thu, 20 Mar 2025 23:37:16 +0100 Subject: [PATCH 1/5] test: increase errors in PropertyDeclaration Probably caused by update in slevomat or squizlabs I don't really want to dig what's new, all are legit finds: ``` vendor/bin/phpcs `find tests/input/PropertyDeclaration.php` WARNING: The PHPCS Coding Standards for doctrine/coding-standards standard uses 1 deprecated sniff ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - SlevomatCodingStandard.TypeHints.UnionTypeHintFormat This sniff has been deprecated since Slevomat Coding Standard 8.16.0 and will be removed in Slevomat Coding Standard 9.0.0. Use SlevomatCodingStandard.TypeHints.DNFTypeHintFormat instead. Deprecated sniffs are still run, but will stop working at some point in the future. E 1 / 1 (100%) FILE: tests/input/PropertyDeclaration.php -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 16 ERRORS AFFECTING 5 LINES -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 9 | ERROR | [x] Equals sign not aligned correctly; expected 1 space but found 2 spaces (Generic.Formatting.MultipleStatementAlignment.Incorrect) 10 | ERROR | [x] There must be exactly one space between type hint and property $stringProperty. (SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBetweenTypeHintAndProperty) 10 | ERROR | [x] There must be 1 space after the property type declaration; 2 found (PSR2.Classes.PropertyDeclaration.SpacingAfterType) 11 | ERROR | [x] Scope keyword "public" must be followed by a single space; found 2 (Squiz.WhiteSpace.ScopeKeywordSpacing.Incorrect) 11 | ERROR | [x] There must be exactly one space before type hint of property $intProperty. (SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBeforeTypeHint) 12 | ERROR | [x] Usage of short nullable type hint in "?string" is disallowed. (SlevomatCodingStandard.TypeHints.UnionTypeHintFormat.DisallowedShortNullable) 12 | ERROR | [x] There must be no whitespace between type hint nullability symbol and type hint of property $nullableString. (SlevomatCodingStandard.Classes.PropertyDeclaration.WhitespaceAfterNullabilitySymbol) 15 | ERROR | [x] Expected 1 space after visibility modifier "public"; 2 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterVisbility) 15 | ERROR | [x] Scope keyword "public" must be followed by a single space; found 2 (Squiz.WhiteSpace.ScopeKeywordSpacing.Incorrect) 15 | ERROR | [x] There must be exactly one space between modifiers of property $foo. (SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBetweenModifiers) 15 | ERROR | [x] Expected 1 space after readonly modifier; 2 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterReadonly) 15 | ERROR | [x] Scope keyword "readonly" must be followed by a single space; found 2 (Squiz.WhiteSpace.ScopeKeywordSpacing.Incorrect) 15 | ERROR | [x] There must be exactly one space before type hint of property $foo. (SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBeforeTypeHint) 15 | ERROR | [x] Expected 1 space between type hint and argument "$foo"; 2 found (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint) 15 | ERROR | [x] There must be exactly one space between parameter type hint and parameter $foo. (SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing.MultipleSpacesBetweenTypeHintAndParameter) 15 | ERROR | [x] There must be exactly one space between type hint and property $foo. (SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBetweenTypeHintAndProperty) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 16 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Time: 95ms; Memory: 12MB ``` --- tests/expected_report.txt | 6 +++--- tests/php72-compatibility.patch | 6 +++--- tests/php73-compatibility.patch | 6 +++--- tests/php74-compatibility.patch | 6 +++--- tests/php80-compatibility.patch | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/expected_report.txt b/tests/expected_report.txt index a646ff68..66dd01fd 100644 --- a/tests/expected_report.txt +++ b/tests/expected_report.txt @@ -34,7 +34,7 @@ tests/input/null_coalesce_equal_operator.php 5 0 tests/input/null_coalesce_operator.php 3 0 tests/input/null_safe_operator.php 1 0 tests/input/optimized-functions.php 1 0 -tests/input/PropertyDeclaration.php 14 0 +tests/input/PropertyDeclaration.php 16 0 tests/input/return_type_on_closures.php 26 0 tests/input/return_type_on_methods.php 22 0 tests/input/semicolon_spacing.php 3 0 @@ -54,9 +54,9 @@ tests/input/use-ordering.php 1 0 tests/input/useless-semicolon.php 2 0 tests/input/UselessConditions.php 21 0 ---------------------------------------------------------------------- -A TOTAL OF 464 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES +A TOTAL OF 466 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES ---------------------------------------------------------------------- -PHPCBF CAN FIX 380 OF THESE SNIFF VIOLATIONS AUTOMATICALLY +PHPCBF CAN FIX 382 OF THESE SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------- diff --git a/tests/php72-compatibility.patch b/tests/php72-compatibility.patch index 6897e1e3..2e53b862 100644 --- a/tests/php72-compatibility.patch +++ b/tests/php72-compatibility.patch @@ -37,7 +37,7 @@ index a646ff6..84c9474 100644 tests/input/null_coalesce_operator.php 3 0 -tests/input/null_safe_operator.php 1 0 tests/input/optimized-functions.php 1 0 --tests/input/PropertyDeclaration.php 14 0 +-tests/input/PropertyDeclaration.php 16 0 -tests/input/return_type_on_closures.php 26 0 -tests/input/return_type_on_methods.php 22 0 +tests/input/PropertyDeclaration.php 6 0 @@ -60,10 +60,10 @@ index a646ff6..84c9474 100644 -tests/input/UselessConditions.php 21 0 +tests/input/UselessConditions.php 20 0 ---------------------------------------------------------------------- --A TOTAL OF 464 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES +-A TOTAL OF 466 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES +A TOTAL OF 415 ERRORS AND 2 WARNINGS WERE FOUND IN 46 FILES ---------------------------------------------------------------------- --PHPCBF CAN FIX 380 OF THESE SNIFF VIOLATIONS AUTOMATICALLY +-PHPCBF CAN FIX 382 OF THESE SNIFF VIOLATIONS AUTOMATICALLY +PHPCBF CAN FIX 331 OF THESE SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------- diff --git a/tests/php73-compatibility.patch b/tests/php73-compatibility.patch index 280221b2..a601fc0a 100644 --- a/tests/php73-compatibility.patch +++ b/tests/php73-compatibility.patch @@ -28,7 +28,7 @@ index d1e1fad..9a78bc1 100644 tests/input/null_coalesce_operator.php 3 0 -tests/input/null_safe_operator.php 1 0 tests/input/optimized-functions.php 1 0 --tests/input/PropertyDeclaration.php 14 0 +-tests/input/PropertyDeclaration.php 16 0 -tests/input/return_type_on_closures.php 26 0 -tests/input/return_type_on_methods.php 22 0 +tests/input/PropertyDeclaration.php 6 0 @@ -52,10 +52,10 @@ index d1e1fad..9a78bc1 100644 -tests/input/UselessConditions.php 21 0 +tests/input/UselessConditions.php 20 0 ---------------------------------------------------------------------- --A TOTAL OF 464 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES +-A TOTAL OF 466 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES +A TOTAL OF 419 ERRORS AND 2 WARNINGS WERE FOUND IN 47 FILES ---------------------------------------------------------------------- --PHPCBF CAN FIX 380 OF THESE SNIFF VIOLATIONS AUTOMATICALLY +-PHPCBF CAN FIX 382 OF THESE SNIFF VIOLATIONS AUTOMATICALLY +PHPCBF CAN FIX 335 OF THESE SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------- diff --git a/tests/php74-compatibility.patch b/tests/php74-compatibility.patch index 597c34e0..115ed57a 100644 --- a/tests/php74-compatibility.patch +++ b/tests/php74-compatibility.patch @@ -26,7 +26,7 @@ index d1e1fad..ed67841 100644 tests/input/null_coalesce_operator.php 3 0 -tests/input/null_safe_operator.php 1 0 tests/input/optimized-functions.php 1 0 --tests/input/PropertyDeclaration.php 14 0 +-tests/input/PropertyDeclaration.php 16 0 -tests/input/return_type_on_closures.php 26 0 -tests/input/return_type_on_methods.php 22 0 +tests/input/PropertyDeclaration.php 6 0 @@ -50,10 +50,10 @@ index d1e1fad..ed67841 100644 -tests/input/UselessConditions.php 21 0 +tests/input/UselessConditions.php 20 0 ---------------------------------------------------------------------- --A TOTAL OF 464 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES +-A TOTAL OF 466 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES +A TOTAL OF 428 ERRORS AND 2 WARNINGS WERE FOUND IN 47 FILES ---------------------------------------------------------------------- --PHPCBF CAN FIX 380 OF THESE SNIFF VIOLATIONS AUTOMATICALLY +-PHPCBF CAN FIX 382 OF THESE SNIFF VIOLATIONS AUTOMATICALLY +PHPCBF CAN FIX 344 OF THESE SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------- diff --git a/tests/php80-compatibility.patch b/tests/php80-compatibility.patch index 03800e58..75c810b5 100644 --- a/tests/php80-compatibility.patch +++ b/tests/php80-compatibility.patch @@ -14,7 +14,7 @@ index d1e1fad..71022c4 100644 tests/input/null_coalesce_operator.php 3 0 tests/input/null_safe_operator.php 1 0 tests/input/optimized-functions.php 1 0 --tests/input/PropertyDeclaration.php 14 0 +-tests/input/PropertyDeclaration.php 16 0 +tests/input/PropertyDeclaration.php 11 0 tests/input/return_type_on_closures.php 26 0 tests/input/return_type_on_methods.php 22 0 @@ -23,10 +23,10 @@ index d1e1fad..71022c4 100644 tests/input/useless-semicolon.php 2 0 tests/input/UselessConditions.php 21 0 ---------------------------------------------------------------------- --A TOTAL OF 464 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES +-A TOTAL OF 466 ERRORS AND 2 WARNINGS WERE FOUND IN 50 FILES +A TOTAL OF 458 ERRORS AND 2 WARNINGS WERE FOUND IN 49 FILES ---------------------------------------------------------------------- --PHPCBF CAN FIX 380 OF THESE SNIFF VIOLATIONS AUTOMATICALLY +-PHPCBF CAN FIX 382 OF THESE SNIFF VIOLATIONS AUTOMATICALLY +PHPCBF CAN FIX 374 OF THESE SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------- From 5fcb4d3c3213a691d1311838cb888098d3283417 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Tue, 18 Mar 2025 09:03:32 +0100 Subject: [PATCH 2/5] style: format phpcs.xml.dist --- phpcs.xml.dist | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 4a3a2a92..fc83e6ae 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -6,17 +6,17 @@ > Check the code of the sniffs in doctrine/coding-standards. - - + + - + - + - + lib From 9a8ccdcb816405fdd5064bea21ff0d124871de92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Thu, 20 Mar 2025 15:11:36 +0100 Subject: [PATCH 3/5] Setup Dependabot for Github Actions --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9daf9929..20d68c72 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -19,3 +19,9 @@ updates: - 7.0.2 - 7.0.4 - 7.0.5 +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + labels: + - "CI" From 565c3154e43e142481c4d6d30c12bc2f25e481c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 13:25:48 +0000 Subject: [PATCH 4/5] chore(deps): bump actions/checkout from 2 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci-dockerfile.yml | 2 +- .github/workflows/ci-shell-scripts.yml | 2 +- .github/workflows/continuous-integration.yml | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-dockerfile.yml b/.github/workflows/ci-dockerfile.yml index ee2e78f6..4bc2247d 100644 --- a/.github/workflows/ci-dockerfile.yml +++ b/.github/workflows/ci-dockerfile.yml @@ -22,7 +22,7 @@ jobs: runs-on: "ubuntu-22.04" steps: - - uses: "actions/checkout@v3" + - uses: "actions/checkout@v4" - name: "Lint Dockerfile" uses: "hadolint/hadolint-action@v3.1.0" diff --git a/.github/workflows/ci-shell-scripts.yml b/.github/workflows/ci-shell-scripts.yml index e3b4fbf8..58652872 100644 --- a/.github/workflows/ci-shell-scripts.yml +++ b/.github/workflows/ci-shell-scripts.yml @@ -24,7 +24,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Lint shell scripts with ShellCheck" uses: "ludeeus/action-shellcheck@2.0.0" diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index ce0e6e2f..5c40277e 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -23,7 +23,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v4" - name: "Install PHP" uses: "shivammathur/setup-php@v2" @@ -56,7 +56,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v4" - name: "Install PHP" uses: "shivammathur/setup-php@v2" @@ -100,7 +100,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v4" - name: "Install PHP" uses: "shivammathur/setup-php@v2" @@ -139,7 +139,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v4" - name: "Install PHP" uses: "shivammathur/setup-php@v2" From e29d319db8e82a75ee72de69176d5adcc400f05e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 13:25:51 +0000 Subject: [PATCH 5/5] chore(deps): bump doctrine/.github from 2.0.0 to 7.2.2 Bumps [doctrine/.github](https://github.com/doctrine/.github) from 2.0.0 to 7.2.2. - [Release notes](https://github.com/doctrine/.github/releases) - [Commits](https://github.com/doctrine/.github/compare/2.0.0...7.2.2) --- updated-dependencies: - dependency-name: doctrine/.github dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/release-on-milestone-closed.yml | 2 +- .github/workflows/website-schema.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml index a0c4e1d0..c0bfaa86 100644 --- a/.github/workflows/release-on-milestone-closed.yml +++ b/.github/workflows/release-on-milestone-closed.yml @@ -8,7 +8,7 @@ on: jobs: release: name: "Git tag, release & create merge-up PR" - uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@2.0.0" + uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@7.2.2" secrets: GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} diff --git a/.github/workflows/website-schema.yml b/.github/workflows/website-schema.yml index e251588e..e51b4a58 100644 --- a/.github/workflows/website-schema.yml +++ b/.github/workflows/website-schema.yml @@ -18,4 +18,4 @@ on: jobs: json-validate: name: "Validate JSON schema" - uses: "doctrine/.github/.github/workflows/website-schema.yml@7.1.0" + uses: "doctrine/.github/.github/workflows/website-schema.yml@7.2.2"