File tree 8 files changed +48
-71
lines changed
8 files changed +48
-71
lines changed Original file line number Diff line number Diff line change 6
6
pull_request :
7
7
paths-ignore : ["**.md"]
8
8
9
- env :
10
- COMPOSER_FLAGS : --ansi --no-interaction --no-progress --prefer-dist
9
+ permissions :
10
+ contents : read
11
11
12
12
jobs :
13
13
tests :
@@ -40,29 +40,16 @@ jobs:
40
40
experimental : true
41
41
42
42
steps :
43
- - name : Checkout
44
- uses : actions/checkout@v4
43
+ - uses : actions/checkout@v4
45
44
46
- - name : Install PHP
47
- uses : shivammathur/setup-php@v2
45
+ - uses : shivammathur/setup-php@v2
48
46
with :
47
+ php-version : " ${{ matrix.php-version }}"
49
48
coverage : none
50
- php-version : ${{ matrix.php-version }}
51
49
52
- - name : Get composer cache directory
53
- id : composercache
54
- shell : bash
55
- run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
56
-
57
- - name : Restore cached dependencies
58
- uses : actions/cache@v4
50
+ - uses : ramsey/composer-install@v3
59
51
with :
60
- path : ${{ steps.composercache.outputs.dir }}
61
- key : php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
62
- restore-keys : php-${{ matrix.php-version }}-composer-
63
-
64
- - name : Install latest dependencies
65
- run : composer update ${{ env.COMPOSER_FLAGS }}
52
+ dependency-versions : highest
66
53
67
54
- name : Run tests
68
55
if : ${{ !matrix.experimental }}
Original file line number Diff line number Diff line change 6
6
pull_request :
7
7
paths-ignore : ["**.md"]
8
8
9
- env :
10
- COMPOSER_FLAGS : --ansi --no-interaction --no-progress --prefer-dist
9
+ permissions :
10
+ contents : read
11
11
12
12
jobs :
13
13
tests :
@@ -35,29 +35,16 @@ jobs:
35
35
experimental : true
36
36
37
37
steps :
38
- - name : Checkout
39
- uses : actions/checkout@v4
38
+ - uses : actions/checkout@v4
40
39
41
- - name : Install PHP
42
- uses : shivammathur/setup-php@v2
40
+ - uses : shivammathur/setup-php@v2
43
41
with :
42
+ php-version : " ${{ matrix.php-version }}"
44
43
coverage : xdebug
45
- php-version : ${{ matrix.php-version }}
46
44
47
- - name : Get composer cache directory
48
- id : composercache
49
- shell : bash
50
- run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
51
-
52
- - name : Restore cached dependencies
53
- uses : actions/cache@v4
45
+ - uses : ramsey/composer-install@v3
54
46
with :
55
- path : ${{ steps.composercache.outputs.dir }}
56
- key : php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
57
- restore-keys : php-${{ matrix.php-version }}-composer-
58
-
59
- - name : Install latest dependencies
60
- run : composer update ${{ env.COMPOSER_FLAGS }}
47
+ dependency-versions : highest
61
48
62
49
- name : Run tests
63
50
if : ${{ !matrix.experimental }}
Original file line number Diff line number Diff line change 6
6
pull_request :
7
7
paths-ignore : ["**.md"]
8
8
9
+ permissions :
10
+ contents : read
11
+
9
12
jobs :
10
13
tests :
11
- name : Lint
14
+ name : " Lint"
12
15
13
16
runs-on : ubuntu-latest
14
17
15
18
strategy :
16
19
matrix :
17
20
php-version :
18
21
- " 7.2"
19
- - " latest "
22
+ - " nightly "
20
23
21
24
steps :
22
- - name : Checkout
23
- uses : actions/checkout@v4
25
+ - uses : actions/checkout@v4
24
26
25
- - name : Install PHP
26
- uses : shivammathur/setup-php@v2
27
+ - uses : shivammathur/setup-php@v2
27
28
with :
29
+ php-version : " ${{ matrix.php-version }}"
28
30
coverage : none
29
- php-version : ${{ matrix.php-version }}
30
31
31
- - name : Lint PHP files
32
- run : " find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f"
32
+ - name : " Lint PHP files"
33
+ run : |
34
+ hasErrors=0
35
+ for f in $(find src/ tests/ -type f -name '*.php' ! -path '*/vendor/*' ! -path '*/Fixtures/*')
36
+ do
37
+ { error="$(php -derror_reporting=-1 -ddisplay_errors=1 -l -f $f 2>&1 1>&3 3>&-)"; } 3>&1;
38
+ if [ "$error" != "" ]; then
39
+ while IFS= read -r line; do echo "::error file=$f::$line"; done <<< "$error"
40
+ hasErrors=1
41
+ fi
42
+ done
43
+ if [ $hasErrors -eq 1 ]; then
44
+ exit 1
45
+ fi
Original file line number Diff line number Diff line change 6
6
pull_request :
7
7
paths-ignore : ["**.md"]
8
8
9
- env :
10
- COMPOSER_FLAGS : --ansi --no-interaction --no-progress --prefer-dist
9
+ permissions :
10
+ contents : read
11
11
12
12
jobs :
13
13
tests :
@@ -21,29 +21,16 @@ jobs:
21
21
- " 8.1"
22
22
23
23
steps :
24
- - name : Checkout
25
- uses : actions/checkout@v4
24
+ - uses : actions/checkout@v4
26
25
27
- - name : Install PHP
28
- uses : shivammathur/setup-php@v2
26
+ - uses : shivammathur/setup-php@v2
29
27
with :
28
+ php-version : " ${{ matrix.php-version }}"
30
29
coverage : none
31
- php-version : ${{ matrix.php-version }}
32
30
33
- - name : Get composer cache directory
34
- id : composercache
35
- shell : bash
36
- run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
37
-
38
- - name : Restore cached dependencies
39
- uses : actions/cache@v4
31
+ - uses : ramsey/composer-install@v3
40
32
with :
41
- path : ${{ steps.composercache.outputs.dir }}
42
- key : php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
43
- restore-keys : php-${{ matrix.php-version }}-composer
44
-
45
- - name : Install latest dependencies
46
- run : composer update ${{ env.COMPOSER_FLAGS }}
33
+ dependency-versions : highest
47
34
48
35
- name : Run PHPStan
49
36
run : vendor/bin/phpstan analyse
Original file line number Diff line number Diff line change 23
23
"composer/pcre" : " ^1 || ^2 || ^3"
24
24
},
25
25
"require-dev" : {
26
- "phpstan/phpstan" : " ^1.0 " ,
26
+ "phpstan/phpstan" : " ^1.11 " ,
27
27
"phpstan/phpstan-strict-rules" : " ^1.1" ,
28
28
"phpunit/phpunit" : " ^8.5 || ^9.6 || ^10.5"
29
29
},
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ public function __construct(Output $output)
28
28
/**
29
29
* @inheritdoc
30
30
* @phpstan-param mixed[] $context
31
+ * @param string|\Stringable $message
31
32
*/
32
33
public function log ($ level , $ message , array $ context = array ()): void
33
34
{
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ public function __construct(array $outputLines)
31
31
foreach ($ outputLines as $ line ) {
32
32
$ line = trim ($ line );
33
33
34
- if (!(bool ) preg_match ('/^(.+) \\[( \\d+) \\](.+)$/ ' , $ line , $ matches )) {
34
+ // @phpstan-ignore booleanNot.exprNotBoolean
35
+ if (!preg_match ('/^(.+) \\[( \\d+) \\](.+)$/ ' , $ line , $ matches )) {
35
36
continue ;
36
37
}
37
38
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ class Logger extends AbstractLogger
24
24
/**
25
25
* @inheritdoc
26
26
* @phpstan-param mixed[] $context
27
+ * @param string|\Stringable $message
27
28
*/
28
29
public function log ($ level , $ message , array $ context = []): void
29
30
{
You can’t perform that action at this time.
0 commit comments