Skip to content

Commit c349cad

Browse files
[4.3] Support PHP 8.2 (#542)
1 parent 888448c commit c349cad

File tree

8 files changed

+34
-31
lines changed

8 files changed

+34
-31
lines changed

.github/workflows/static.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@ on:
77
jobs:
88
phpstan_src:
99
name: PHPStan Source
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111

1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1515

1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: 7.4
19+
php-version: 8.2
2020
tools: composer:v2
2121
coverage: none
2222

2323
- name: Install Dependencies
24-
uses: nick-invision/retry@v1
24+
uses: nick-invision/retry@v2
2525
with:
2626
timeout_minutes: 5
2727
max_attempts: 5
2828
command: composer update --no-interaction --no-progress
2929

3030
- name: Install PHPStan
31-
uses: nick-invision/retry@v1
31+
uses: nick-invision/retry@v2
3232
with:
3333
timeout_minutes: 5
3434
max_attempts: 5
@@ -39,28 +39,28 @@ jobs:
3939

4040
phpstan_tests:
4141
name: PHPStan Tests
42-
runs-on: ubuntu-20.04
42+
runs-on: ubuntu-22.04
4343

4444
steps:
4545
- name: Checkout code
46-
uses: actions/checkout@v2
46+
uses: actions/checkout@v3
4747

4848
- name: Setup PHP
4949
uses: shivammathur/setup-php@v2
5050
with:
51-
php-version: 7.4
51+
php-version: 8.2
5252
tools: composer:v2
5353
coverage: none
5454

5555
- name: Install Dependencies
56-
uses: nick-invision/retry@v1
56+
uses: nick-invision/retry@v2
5757
with:
5858
timeout_minutes: 5
5959
max_attempts: 5
6060
command: composer update --no-interaction --no-progress
6161

6262
- name: Install PHPStan
63-
uses: nick-invision/retry@v1
63+
uses: nick-invision/retry@v2
6464
with:
6565
timeout_minutes: 5
6666
max_attempts: 5
@@ -71,28 +71,28 @@ jobs:
7171

7272
psalm:
7373
name: Psalm
74-
runs-on: ubuntu-20.04
74+
runs-on: ubuntu-22.04
7575

7676
steps:
7777
- name: Checkout code
78-
uses: actions/checkout@v2
78+
uses: actions/checkout@v3
7979

8080
- name: Setup PHP
8181
uses: shivammathur/setup-php@v2
8282
with:
83-
php-version: 7.4
83+
php-version: 8.2
8484
tools: composer:v2
8585
coverage: none
8686

8787
- name: Install Dependencies
88-
uses: nick-invision/retry@v1
88+
uses: nick-invision/retry@v2
8989
with:
9090
timeout_minutes: 5
9191
max_attempts: 5
9292
command: composer update --no-interaction --no-progress
9393

9494
- name: Install Psalm
95-
uses: nick-invision/retry@v1
95+
uses: nick-invision/retry@v2
9696
with:
9797
timeout_minutes: 5
9898
max_attempts: 5

.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ on:
77
jobs:
88
tests:
99
name: PHP ${{ matrix.php }}
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111

1212
strategy:
1313
matrix:
14-
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
14+
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
1515

1616
steps:
1717
- name: Checkout Code
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v3
1919

2020
- name: Setup PHP
2121
uses: shivammathur/setup-php@v2
@@ -28,7 +28,7 @@ jobs:
2828
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
2929

3030
- name: Install Dependencies
31-
uses: nick-invision/retry@v1
31+
uses: nick-invision/retry@v2
3232
with:
3333
timeout_minutes: 5
3434
max_attempts: 5

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
install:
2-
@docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:7.4-base update
3-
@docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:7.4-base bin all update
2+
@docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:8.2-base update
3+
@docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:8.2-base bin all update
44

55
phpunit:
6-
@rm -f bootstrap/cache/*.php && docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit --rm registry.gitlab.com/grahamcampbell/php:7.4-cli
6+
@rm -f bootstrap/cache/*.php && docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit --rm registry.gitlab.com/grahamcampbell/php:8.2-cli
77

88
phpstan-analyze-src:
9-
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:7.4-cli analyze src -c phpstan.src.neon.dist
9+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.2-cli analyze src -c phpstan.src.neon.dist
1010

1111
phpstan-analyze-tests:
12-
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:7.4-cli analyze tests -c phpstan.tests.neon.dist
12+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.2-cli analyze tests -c phpstan.tests.neon.dist
1313

1414
psalm-analyze:
15-
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:7.4-cli
15+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:8.2-cli
1616

1717
psalm-show-info:
18-
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:7.4-cli --show-info=true
18+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:8.2-cli --show-info=true
1919

2020
test: phpunit phpstan-analyze-src phpstan-analyze-tests psalm-analyze
2121

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"ext-filter": "*",
2525
"ext-pcre": "*",
2626
"bamarni/composer-bin-plugin": "^1.4.1",
27-
"phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.21"
27+
"phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.30"
2828
},
2929
"autoload": {
3030
"psr-4": {

phpstan.src.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ parameters:
33
ignoreErrors:
44
- '#Call to function is_string\(\) with string will always evaluate to true.#'
55
- '#Variable \$defaults might not be defined.#'
6-
- '#Method Dotenv\\Regex\\Regex::split\(\) should return Dotenv\\Result\\Result\<array\<string\>, string\> but returns Dotenv\\Result\\Result\<array\<int, bool\|string\>, string\>.#'
76
- '/^Parameter \#1 \$readers of class Dotenv\\Repository\\[a-zA-Z]*Repository[a-zA-Z]* constructor expects/'
87
- '/^Parameter \#2 \$writers of class Dotenv\\Repository\\[a-zA-Z]*Repository[a-zA-Z]* constructor expects/'
98
- '#Parameter \#1 \$name of method Dotenv\\Repository\\AbstractRepository::set\(\) expects string, string\|null given.#'

src/Regex/Regex.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,11 @@ private static function pregAndWrap(callable $operation, $subject)
8888
$result = $operation($subject);
8989

9090
if (($e = preg_last_error()) !== PREG_NO_ERROR) {
91+
/** @var Result<V,string> */
9192
return Error::create(self::lookupError($e));
9293
}
9394

95+
/** @var Result<V,string> */
9496
return Success::create($result);
9597
}
9698

vendor-bin/phpstan/composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"require": {
3-
"phpstan/phpstan": "1.2.0",
3+
"php": "^8.2",
4+
"phpstan/phpstan": "1.8.9",
45
"phpstan/extension-installer": "1.1.0",
56
"phpstan/phpstan-deprecation-rules": "1.0.0",
6-
"phpstan/phpstan-strict-rules": "1.1.0",
7+
"phpstan/phpstan-strict-rules": "1.4.4",
78
"thecodingmachine/phpstan-strict-rules": "1.0.0"
89
},
910
"config": {

vendor-bin/psalm/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"require": {
3-
"psalm/phar": "4.19.0"
3+
"php": "^8.2",
4+
"psalm/phar": "4.29.0"
45
},
56
"config": {
67
"preferred-install": "dist"

0 commit comments

Comments
 (0)