Skip to content

Commit f1f4ca5

Browse files
Drop PHP 7.1 and support PHP 8.3
1 parent 1a7ea2a commit f1f4ca5

17 files changed

+109
-125
lines changed

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
/.gitignore export-ignore
88
/.github export-ignore
99
/Makefile export-ignore
10-
/phpstan.src.neon.dist export-ignore
11-
/phpstan.tests.neon.dist export-ignore
10+
/phpstan-baseline.neon export-ignore
11+
/phpstan.neon.dist export-ignore
1212
/phpunit.xml.dist export-ignore
1313
/psalm-baseline.xml export-ignore
1414
/psalm.xml export-ignore

.github/workflows/static.yml

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,22 @@ on:
55
pull_request:
66

77
jobs:
8-
phpstan_src:
9-
name: PHPStan Source
8+
phpstan:
9+
name: PHPStan
1010
runs-on: ubuntu-22.04
1111

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

1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: 8.2
19+
php-version: '8.3'
2020
tools: composer:v2
2121
coverage: none
22+
env:
23+
update: true
2224

2325
- name: Install Dependencies
2426
uses: nick-invision/retry@v2
@@ -35,54 +37,24 @@ jobs:
3537
command: composer bin phpstan update --no-interaction --no-progress
3638

3739
- name: Execute PHPStan
38-
run: vendor/bin/phpstan analyze src -c phpstan.src.neon.dist --no-progress
39-
40-
phpstan_tests:
41-
name: PHPStan Tests
42-
runs-on: ubuntu-22.04
43-
44-
steps:
45-
- name: Checkout code
46-
uses: actions/checkout@v3
47-
48-
- name: Setup PHP
49-
uses: shivammathur/setup-php@v2
50-
with:
51-
php-version: 8.2
52-
tools: composer:v2
53-
coverage: none
54-
55-
- name: Install Dependencies
56-
uses: nick-invision/retry@v2
57-
with:
58-
timeout_minutes: 5
59-
max_attempts: 5
60-
command: composer update --no-interaction --no-progress
61-
62-
- name: Install PHPStan
63-
uses: nick-invision/retry@v2
64-
with:
65-
timeout_minutes: 5
66-
max_attempts: 5
67-
command: composer bin phpstan update --no-interaction --no-progress
68-
69-
- name: Execute PHPStan
70-
run: vendor/bin/phpstan analyze tests -c phpstan.tests.neon.dist --no-progress
40+
run: vendor/bin/phpstan analyze --no-progress
7141

7242
psalm:
7343
name: Psalm
7444
runs-on: ubuntu-22.04
7545

7646
steps:
7747
- name: Checkout code
78-
uses: actions/checkout@v3
48+
uses: actions/checkout@v4
7949

8050
- name: Setup PHP
8151
uses: shivammathur/setup-php@v2
8252
with:
83-
php-version: 8.2
53+
php-version: '8.3'
8454
tools: composer:v2
8555
coverage: none
56+
env:
57+
update: true
8658

8759
- name: Install Dependencies
8860
uses: nick-invision/retry@v2

.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111

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

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

2020
- name: Setup PHP
2121
uses: shivammathur/setup-php@v2
@@ -43,11 +43,11 @@ jobs:
4343

4444
strategy:
4545
matrix:
46-
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
46+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
4747

4848
steps:
4949
- name: Checkout Code
50-
uses: actions/checkout@v3
50+
uses: actions/checkout@v4
5151

5252
- name: Setup PHP
5353
uses: shivammathur/setup-php@v2

Makefile

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

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

8-
phpstan-analyze-src:
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
8+
phpstan-analyze:
9+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.3-cli analyze
1010

11-
phpstan-analyze-tests:
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
11+
phpstan-baseline:
12+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.3-cli analyze --generate-baseline
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:8.2-cli
15+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:8.3-cli
1616

1717
psalm-baseline:
18-
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:7.4-cli --set-baseline=psalm-baseline.xml
18+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:8.3-cli --set-baseline=psalm-baseline.xml
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:8.2-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.3-cli --show-info=true
2222

23-
test: phpunit phpstan-analyze-src phpstan-analyze-tests psalm-analyze
23+
test: phpunit phpstan-analyze psalm-analyze
2424

2525
clean:
2626
@rm -rf .phpunit.result.cache composer.lock vendor vendor-bin/*/composer.lock vendor-bin/*/vendor

UPGRADING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Upgrading Guide
22

3+
## V5.5 to V5.6
4+
5+
Bumping the minimum required PHP version is not a breaking change, however it is notable. Since version 5.6.0, we now require PHP 7.2.5 or higher. Installation metrics show that for some time, PHP 7.1 has represented only around 0.1% of installs of V5.
6+
7+
Release notes for 5.6.0 are available [here](https://github.com/vlucas/phpdotenv/releases/tag/v5.6.0).
8+
39
## V4 to V5
410

511
### Introduction

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.1.3 || ^8.0",
19+
"php": "^7.2.5 || ^8.0",
2020
"ext-pcre": "*",
21-
"graham-campbell/result-type": "^1.0.2",
22-
"phpoption/phpoption": "^1.8",
23-
"symfony/polyfill-ctype": "^1.23",
24-
"symfony/polyfill-mbstring": "^1.23.1",
25-
"symfony/polyfill-php80": "^1.23.1"
21+
"graham-campbell/result-type": "^1.1.2",
22+
"phpoption/phpoption": "^1.9.2",
23+
"symfony/polyfill-ctype": "^1.24",
24+
"symfony/polyfill-mbstring": "^1.24",
25+
"symfony/polyfill-php80": "^1.24"
2626
},
2727
"require-dev": {
2828
"ext-filter": "*",
29-
"bamarni/composer-bin-plugin": "^1.4.1",
30-
"phpunit/phpunit": "^7.5.20 || ^8.5.30 || ^9.5.25"
29+
"bamarni/composer-bin-plugin": "^1.8.2",
30+
"phpunit/phpunit":"^8.5.34 || ^9.6.13 || ^10.4.2"
3131
},
3232
"autoload": {
3333
"psr-4": {
@@ -54,7 +54,7 @@
5454
"forward-command": true
5555
},
5656
"branch-alias": {
57-
"dev-master": "5.5-dev"
57+
"dev-master": "5.6-dev"
5858
}
5959
}
6060
}

phpstan-baseline.neon

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Anonymous function should return GrahamCampbell\\\\ResultType\\\\Result\\<array\\{mixed, mixed\\}, string\\> but returns GrahamCampbell\\\\ResultType\\\\Result\\<array\\{Dotenv\\\\Parser\\\\Value, mixed\\}, string\\>\\.$#"
5+
count: 1
6+
path: src/Parser/EntryParser.php
7+
8+
-
9+
message: "#^Only booleans are allowed in a negated boolean, int\\|false given\\.$#"
10+
count: 1
11+
path: src/Parser/Lexer.php
12+
13+
-
14+
message: "#^Parameter \\#1 \\$readers of class Dotenv\\\\Repository\\\\RepositoryBuilder constructor expects array\\<Dotenv\\\\Repository\\\\Adapter\\\\ReaderInterface\\>, array\\<Dotenv\\\\Repository\\\\Adapter\\\\ReaderInterface\\|S\\> given\\.$#"
15+
count: 2
16+
path: src/Repository/RepositoryBuilder.php
17+
18+
-
19+
message: "#^Parameter \\#2 \\$writers of class Dotenv\\\\Repository\\\\RepositoryBuilder constructor expects array\\<Dotenv\\\\Repository\\\\Adapter\\\\WriterInterface\\>, array\\<Dotenv\\\\Repository\\\\Adapter\\\\WriterInterface\\|S\\> given\\.$#"
20+
count: 2
21+
path: src/Repository/RepositoryBuilder.php

phpstan.neon.dist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
includes:
2+
- phpstan-baseline.neon
3+
4+
parameters:
5+
level: max
6+
paths:
7+
- src

phpstan.src.neon.dist

Lines changed: 0 additions & 7 deletions
This file was deleted.

phpstan.tests.neon.dist

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)