Skip to content

Commit b1328d8

Browse files
committed
Update lint script
1 parent 584f776 commit b1328d8

3 files changed

Lines changed: 30 additions & 10 deletions

File tree

.github/workflows/continuous-integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
- push
55
- pull_request
66

7-
env:
8-
SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT: "1"
7+
permissions:
8+
contents: read
99

1010
jobs:
1111
tests:

.github/workflows/lint.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
- push
55
- pull_request
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
tests:
912
name: "Lint"
@@ -14,17 +17,34 @@ jobs:
1417
matrix:
1518
php-version:
1619
- "7.2"
17-
- "8.3"
20+
- "nightly"
1821

1922
steps:
20-
- name: "Checkout"
21-
uses: "actions/checkout@v4"
23+
- uses: actions/checkout@v4
2224

23-
- name: "Install PHP"
24-
uses: "shivammathur/setup-php@v2"
25+
- uses: shivammathur/setup-php@v2
2526
with:
26-
coverage: "none"
2727
php-version: "${{ matrix.php-version }}"
28+
coverage: none
29+
30+
- uses: ramsey/composer-install@v3
31+
with:
32+
dependency-versions: highest
33+
34+
- name: "Lint PHP files"
35+
run: |
36+
hasErrors=0
37+
for f in $(find src/ tests/ -type f -name '*.php' ! -path '*/vendor/*')
38+
do
39+
{ error="$(php -derror_reporting=-1 -ddisplay_errors=1 -l -f $f 2>&1 1>&3 3>&-)"; } 3>&1;
40+
if [ "$error" != "" ]; then
41+
while IFS= read -r line; do echo "::error file=$f::$line"; done <<< "$error"
42+
hasErrors=1
43+
fi
44+
done
45+
if [ $hasErrors -eq 1 ]; then
46+
exit 1
47+
fi
2848
2949
- name: "Lint PHP files"
3050
run: "find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f"

.github/workflows/phpstan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
- push
55
- pull_request
66

7-
env:
8-
SYMFONY_PHPUNIT_VERSION: ""
7+
permissions:
8+
contents: read
99

1010
jobs:
1111
tests:

0 commit comments

Comments
 (0)