Skip to content

Commit dc5ff11

Browse files
Drop PHP versions less than 7.2.5 and support PHP 8.2 (#68)
1 parent 39bb936 commit dc5ff11

File tree

8 files changed

+50
-33
lines changed

8 files changed

+50
-33
lines changed

.github/workflows/static.yml

+15-15
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.1
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.1
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.1
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

+8-4
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: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
14+
php: ['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
@@ -27,8 +27,12 @@ jobs:
2727
- name: Setup Problem Matchers
2828
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
2929

30+
- name: Mimic PHP 8.1
31+
run: composer config platform.php 8.1.999
32+
if: matrix.php > 8.1
33+
3034
- name: Install PHP Dependencies
31-
uses: nick-invision/retry@v1
35+
uses: nick-invision/retry@v2
3236
with:
3337
timeout_minutes: 5
3438
max_attempts: 5

Makefile

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
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.1-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.1-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.1-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.1-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.1-cli analyze tests -c phpstan.tests.neon.dist
1313

1414
phpstan-baseline:
15-
@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 --generate-baseline
15+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.1-cli analyze src -c phpstan.src.neon.dist --generate-baseline
1616

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

2020
psalm-show-info:
21-
@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
21+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm .phar--rm registry.gitlab.com/grahamcampbell/php:8.1-cli --show-info=true
2222

2323
test: phpunit phpstan-analyze-src phpstan-analyze-tests psalm-analyze
2424

composer.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.0 || ^8.0"
19+
"php": "^7.2.5 || ^8.0"
2020
},
2121
"require-dev": {
22-
"bamarni/composer-bin-plugin": "^1.4.1",
23-
"phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8"
22+
"bamarni/composer-bin-plugin": "^1.8",
23+
"phpunit/phpunit": "^8.5.28 || ^9.5.21"
2424
},
2525
"autoload": {
2626
"psr-4": {
@@ -39,8 +39,12 @@
3939
"preferred-install": "dist"
4040
},
4141
"extra": {
42+
"bamarni-bin": {
43+
"bin-links": true,
44+
"forward-command": true
45+
},
4246
"branch-alias": {
43-
"dev-master": "1.8-dev"
47+
"dev-master": "1.9-dev"
4448
}
4549
},
4650
"minimum-stability": "dev",

phpstan-baseline.neon

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
parameters:
22
ignoreErrors:
3+
-
4+
message: "#^Method PhpOption\\\\Option\\:\\:ensure\\(\\) should return PhpOption\\\\Option\\<S\\> but returns PhpOption\\\\LazyOption\\<mixed\\>\\.$#"
5+
count: 1
6+
path: src/PhpOption/Option.php
7+
38
-
49
message: "#^Method PhpOption\\\\Option\\:\\:fromReturn\\(\\) should return PhpOption\\\\LazyOption\\<S\\> but returns PhpOption\\\\LazyOption\\<mixed\\>\\.$#"
510
count: 1

tests/PhpOption/Tests/OptionTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -134,21 +134,25 @@ class SomeArrayObject implements ArrayAccess
134134
{
135135
private $data = [];
136136

137+
#[\ReturnTypeWillChange]
137138
public function offsetExists($offset)
138139
{
139140
return isset($this->data[$offset]);
140141
}
141142

143+
#[\ReturnTypeWillChange]
142144
public function offsetGet($offset)
143145
{
144146
return $this->data[$offset];
145147
}
146148

149+
#[\ReturnTypeWillChange]
147150
public function offsetSet($offset, $value)
148151
{
149152
$this->data[$offset] = $value;
150153
}
151154

155+
#[\ReturnTypeWillChange]
152156
public function offsetUnset($offset)
153157
{
154158
unset($this->data[$offset]);

vendor-bin/phpstan/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"phpstan/phpstan": "1.2.0"
3+
"phpstan/phpstan": "1.8.2"
44
},
55
"config": {
66
"preferred-install": "dist"

vendor-bin/psalm/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"psalm/phar": "4.14.0"
3+
"psalm/phar": "4.25.0"
44
},
55
"config": {
66
"preferred-install": "dist"

0 commit comments

Comments
 (0)