Skip to content

Commit

Permalink
github wf: run check_code with php 8.2
Browse files Browse the repository at this point in the history
and avoid exit-code 1 when version of PHP doesn't match php-cs-fixer's
requirements
  • Loading branch information
tenzap committed Oct 29, 2024
1 parent 7ff153a commit 5140c88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/codeigniter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.2']
php-versions: ['8.2']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
Expand Down
6 changes: 6 additions & 0 deletions utils/fix_code_style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ fi
if [[ "$STRICT_COMPARISON" == "1" ]]; then
${VENDOR_DIR}/bin/php-cs-fixer fix -v --show-progress=dots --allow-risky=yes --dry-run --diff --config "$CS_FIXER_CONF_DIR/php-cs-fixer-5-strict_comparison.php" > "$DIFF_OUTPUT_DIR/code_style_check-strict_comparison.diff"
EXIT_CODE=$?
if [ $EXIT_CODE = 1 ]; then
# Relaunch with PHP_CS_FIXER_IGNORE_ENV=1 to be sure that the error si related to env.
# See: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/usage.rst#environment-options
PHP_CS_FIXER_IGNORE_ENV=1 ${VENDOR_DIR}/bin/php-cs-fixer fix -v --show-progress=dots --allow-risky=yes --dry-run --diff --config "$CS_FIXER_CONF_DIR/php-cs-fixer-5-strict_comparison.php" > /dev/null 2>&1
EXIT_CODE=$?
fi
if [ $EXIT_CODE -eq 8 ] || [ $EXIT_CODE -eq 4 ]; then
# 4 - Some files have invalid syntax (only in dry-run mode).
# 8 - Some files need fixing (only in dry-run mode).
Expand Down

0 comments on commit 5140c88

Please sign in to comment.