Skip to content

Commit 06f49ee

Browse files
chore(deps-dev): bump squizlabs/php_codesniffer from 3.13.5 to 4.0.4 in the composer-dependencies group (#226)
* chore(deps-dev): bump squizlabs/php_codesniffer Bumps the composer-dependencies group with 1 update: [squizlabs/php_codesniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer). Updates `squizlabs/php_codesniffer` from 3.13.5 to 4.0.4 - [Release notes](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases) - [Changelog](https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/4.x/CHANGELOG-3.x.md) - [Commits](PHPCSStandards/PHP_CodeSniffer@3.13.5...4.0.4) --- updated-dependencies: - dependency-name: squizlabs/php_codesniffer dependency-version: 4.0.4 dependency-type: direct:development update-type: version-update:semver-major dependency-group: composer-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * fix(ci): use Composer PHP_CodeSniffer --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Manoel Aranda Neto <marandaneto@gmail.com>
1 parent f927623 commit 06f49ee

4 files changed

Lines changed: 29 additions & 39 deletions

File tree

‎.github/workflows/php.yml‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,29 +132,27 @@ jobs:
132132
with:
133133
fetch-depth: 0 # important!
134134

135-
# we may use whatever way to install phpcs, just specify the path on the next step
136-
# however, curl seems to be the fastest
137-
- name: Install PHP_CodeSniffer
135+
- name: Set up PHP 8.4
138136
if: needs.detect-markdown-only.outputs.markdown_only != 'true'
139-
run: |
140-
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
141-
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
142-
php phpcs.phar --version
143-
php phpcbf.phar --version
137+
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
138+
with:
139+
php-version: 8.4
140+
tools: composer
141+
142+
- name: Install Dependencies
143+
if: needs.detect-markdown-only.outputs.markdown_only != 'true'
144+
run: composer install --prefer-dist --no-progress
144145

145146
- name: Check PHP formatting
146147
if: needs.detect-markdown-only.outputs.markdown_only != 'true'
147148
run: |
148-
php phpcbf.phar --standard=phpcs.xml --no-colors || phpcbf_status=$?
149-
if [ "${phpcbf_status:-0}" -gt 1 ]; then
150-
exit "$phpcbf_status"
151-
fi
149+
./vendor/bin/phpcbf --standard=phpcs.xml --no-colors --runtime-set ignore_non_auto_fixable_on_exit 1
152150
git diff --exit-code -- lib test
153151
154152
- uses: tinovyatkin/action-php-codesniffer@0043b33b3629611c37e8bc7ee8a4e061dc9a7ea2 # v1
155153
if: needs.detect-markdown-only.outputs.markdown_only != 'true'
156154
with:
157155
files: "**.php" # you may customize glob as needed
158-
phpcs_path: php phpcs.phar
156+
phpcs_path: ./vendor/bin/phpcs
159157
standard: phpcs.xml
160158
scope: "file"

‎bin/fmt‎

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,10 @@ fi
1515

1616
# Run PHPCBF on all PHP files in lib/ and test/ directories
1717
echo "Running PHPCBF on lib/ and test/ directories..."
18-
./vendor/bin/phpcbf --standard=phpcs.xml lib/ test/ || {
19-
# PHPCBF returns exit code 1 when it fixes files, which is expected behavior
20-
# Only fail if it's a different error (exit code 2 or higher)
21-
exit_code=$?
22-
if [ $exit_code -gt 1 ]; then
23-
fatal "PHPCBF failed with exit code $exit_code"
24-
fi
25-
echo "PHPCBF finished fixing files (exit code $exit_code is expected when fixes are made)"
26-
}
18+
./vendor/bin/phpcbf --standard=phpcs.xml --runtime-set ignore_non_auto_fixable_on_exit 1 lib/ test/
2719

2820
# Also format the example.php file
2921
echo "Running PHPCBF on example.php..."
30-
./vendor/bin/phpcbf --standard=phpcs.xml example.php || {
31-
exit_code=$?
32-
if [ $exit_code -gt 1 ]; then
33-
fatal "PHPCBF failed on example.php with exit code $exit_code"
34-
fi
35-
}
22+
./vendor/bin/phpcbf --standard=phpcs.xml --runtime-set ignore_non_auto_fixable_on_exit 1 example.php
3623

37-
echo "PHP formatting complete!"
24+
echo "PHP formatting complete!"

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"require-dev": {
2222
"phpunit/phpunit": "^11.0",
23-
"squizlabs/php_codesniffer": "^3.7"
23+
"squizlabs/php_codesniffer": "^4.0"
2424
},
2525
"autoload": {
2626
"psr-4": {

‎composer.lock‎

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

0 commit comments

Comments
 (0)