| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- name: "PHP Lint"
- on:
- - push
- - pull_request
- permissions:
- contents: read
- jobs:
- tests:
- name: "Lint"
- runs-on: ubuntu-latest
- strategy:
- matrix:
- php-version:
- - "8.1"
- - "nightly"
- steps:
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5
- with:
- php-version: "${{ matrix.php-version }}"
- coverage: none
- - name: "Lint PHP files"
- run: |
- hasErrors=0
- for f in $(find src/ tests/ -type f -name '*.php' ! -path '*/vendor/*' ! -path '*/Fixtures/*')
- do
- { error="$(php -derror_reporting=-1 -ddisplay_errors=1 -l -f $f 2>&1 1>&3 3>&-)"; } 3>&1;
- if [ "$error" != "" ]; then
- while IFS= read -r line; do echo "::error file=$f::$line"; done <<< "$error"
- hasErrors=1
- fi
- done
- if [ $hasErrors -eq 1 ]; then
- exit 1
- fi
|