Skip to content

Commit 46702d3

Browse files
Merge branch '5.0'
2 parents ad9eb3f + 90f2751 commit 46702d3

File tree

17 files changed

+276
-58
lines changed

17 files changed

+276
-58
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
/.gitattributes export-ignore
66
/.github export-ignore
77
/.gitignore export-ignore
8-
/.travis.yml export-ignore
8+
/.github export-ignore
99
/phpstan.neon.dist export-ignore
1010
/phpstan.tests.neon.dist export-ignore
1111
/phpunit.xml.dist export-ignore
12+
/psalm.xml export-ignore
1213
/README.md export-ignore
1314
/UPGRADING.md export-ignore
1415
/vendor-bin export-ignore

.github/CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ We accept contributions via pull requests on Github. Please review these guideli
66

77
## Guidelines
88

9-
* Please follow the [PSR-2 Coding Style Guide](https://www.php-fig.org/psr/psr-2/)..
9+
* Please follow the [PSR-2 Coding Style Guide](https://www.php-fig.org/psr/psr-2/).
1010
* Ensure that the current tests pass, and if you've added something new, add the tests where relevant.
1111
* Send a coherent commit history, making sure each individual commit in your pull request is meaningful.
1212
* You may need to [rebase](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) to avoid merge conflicts.
@@ -18,13 +18,13 @@ We accept contributions via pull requests on Github. Please review these guideli
1818
First, install the dependencies using [Composer](https://getcomposer.org/):
1919

2020
```bash
21-
$ composer install
21+
$ make install
2222
```
2323

24-
Then run [PHPUnit](https://phpunit.de/):
24+
Then run [PHPUnit](https://phpunit.de/) and the static analyzers:
2525

2626
```bash
27-
$ vendor/bin/phpunit
27+
$ make test
2828
```
2929

30-
The tests will be automatically run by [Travis CI](https://travis-ci.org/) against pull requests.
30+
These will also be automatically run by [GitHub Actions](https://github.com/features/actions) against pull requests.

.github/workflows/static.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Static Analysis
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
phpstan_src:
9+
name: PHPStan Source
10+
runs-on: ubuntu-20.04
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: 7.4
20+
tools: composer:v2
21+
coverage: none
22+
23+
- name: Install Dependencies
24+
uses: nick-invision/retry@v1
25+
with:
26+
timeout_minutes: 5
27+
max_attempts: 5
28+
command: composer update --no-interaction --no-progress
29+
30+
- name: Install PHPStan
31+
uses: nick-invision/retry@v1
32+
with:
33+
timeout_minutes: 5
34+
max_attempts: 5
35+
command: composer bin phpstan update --no-interaction --no-progress
36+
37+
- 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-20.04
43+
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@v2
47+
48+
- name: Setup PHP
49+
uses: shivammathur/setup-php@v2
50+
with:
51+
php-version: 7.4
52+
tools: composer:v2
53+
coverage: none
54+
55+
- name: Install Dependencies
56+
uses: nick-invision/retry@v1
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@v1
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
71+
72+
psalm:
73+
name: Psalm
74+
runs-on: ubuntu-20.04
75+
76+
steps:
77+
- name: Checkout code
78+
uses: actions/checkout@v2
79+
80+
- name: Setup PHP
81+
uses: shivammathur/setup-php@v2
82+
with:
83+
php-version: 7.4
84+
tools: composer:v2
85+
coverage: none
86+
87+
- name: Install Dependencies
88+
uses: nick-invision/retry@v1
89+
with:
90+
timeout_minutes: 5
91+
max_attempts: 5
92+
command: composer update --no-interaction --no-progress
93+
94+
- name: Install Psalm
95+
uses: nick-invision/retry@v1
96+
with:
97+
timeout_minutes: 5
98+
max_attempts: 5
99+
command: composer bin psalm update --no-interaction --no-progress
100+
101+
- name: Execute Psalm
102+
run: vendor/bin/psalm --no-progress --output-format=github

.github/workflows/tests.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
tests_latest:
9+
name: PHP ${{ matrix.php }} Latest
10+
runs-on: ubuntu-20.04
11+
12+
strategy:
13+
matrix:
14+
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
15+
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v2
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php }}
24+
tools: composer:v2
25+
coverage: none
26+
27+
- name: Setup Problem Matchers
28+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
29+
30+
- name: Install PHP 5/7 Dependencies
31+
uses: nick-invision/retry@v1
32+
with:
33+
timeout_minutes: 5
34+
max_attempts: 5
35+
command: composer update --no-interaction --no-progress
36+
if: "matrix.php < 8"
37+
38+
- name: Install PHP 8 Dependencies
39+
uses: nick-invision/retry@v1
40+
with:
41+
timeout_minutes: 5
42+
max_attempts: 5
43+
command: composer update --no-interaction --no-progress --ignore-platform-reqs
44+
if: "matrix.php >= 8"
45+
46+
- name: Execute PHPUnit
47+
run: vendor/bin/phpunit
48+
49+
jobs:
50+
tests_lowest:
51+
name: PHP ${{ matrix.php }} Lowest
52+
runs-on: ubuntu-20.04
53+
54+
strategy:
55+
matrix:
56+
php: ['7.1', '7.2', '7.3', '7.4']
57+
58+
steps:
59+
- name: Checkout Code
60+
uses: actions/checkout@v2
61+
62+
- name: Setup PHP
63+
uses: shivammathur/setup-php@v2
64+
with:
65+
php-version: ${{ matrix.php }}
66+
tools: composer:v2
67+
coverage: none
68+
69+
- name: Setup Problem Matchers
70+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
71+
72+
- name: Install Lowest Dependencies
73+
uses: nick-invision/retry@v1
74+
with:
75+
timeout_minutes: 5
76+
max_attempts: 5
77+
command: composer update --prefer-lowest --prefer-stable --no-interaction --no-progress
78+
79+
- name: Execute PHPUnit
80+
run: vendor/bin/phpunit

.travis.yml

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

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
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
4+
5+
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
7+
8+
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
10+
11+
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
13+
14+
psalm-analyze:
15+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm --rm registry.gitlab.com/grahamcampbell/php:7.4-cli
16+
17+
psalm-show-info:
18+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm --rm registry.gitlab.com/grahamcampbell/php:7.4-cli --show-info=true
19+
20+
test: phpunit phpstan-analyze-src phpstan-analyze-tests psalm-analyze
21+
22+
clean:
23+
@rm -rf .phpunit.result.cache composer.lock vendor vendor-bin/*/composer.lock vendor-bin/*/vendor

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` au
66
![Banner](https://user-images.githubusercontent.com/2829600/71564012-31105580-2a91-11ea-9ad7-ef1278411b35.png)
77

88
<p align="center">
9-
<a href="https://travis-ci.org/vlucas/phpdotenv"><img src="https://img.shields.io/travis/vlucas/phpdotenv/master.svg?style=flat-square" alt="Build Status"></img></a>
109
<a href="LICENSE"><img src="https://img.shields.io/badge/license-BSD%203--Clause-brightgreen.svg?style=flat-square" alt="Software License"></img></a>
1110
<a href="https://packagist.org/packages/vlucas/phpdotenv"><img src="https://img.shields.io/packagist/dt/vlucas/phpdotenv.svg?style=flat-square" alt="Total Downloads"></img></a>
1211
<a href="https://github.com/vlucas/phpdotenv/releases"><img src="https://img.shields.io/github/release/vlucas/phpdotenv.svg?style=flat-square" alt="Latest Version"></img></a>

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
"ext-filter": "Required to use the boolean validator."
4444
},
4545
"config": {
46-
"preferred-install": "dist",
47-
"platform-check": false
46+
"preferred-install": "dist"
4847
},
4948
"extra": {
5049
"branch-alias": {

phpstan.src.neon.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ parameters:
33
ignoreErrors:
44
- '#Unable to resolve the template type#'
55
- '#Anonymous function should have native return typehint ".+".#'
6-
- '#Method Dotenv\\Parser\\EntryParser::processToken\(\) should return GrahamCampbell\\ResultType\\Result<array.+, string> but returns GrahamCampbell\\ResultType\\Result<array.+, mixed>.#'
7-
- '#Parameter \#1 \$callable of method PhpOption\\Option<bool\|string>::flatMap\(\) expects callable\(bool\|string\): PhpOption\\Option<mixed>, Closure\(string\): mixed given.#'
86
- '#Only booleans are allowed in a negated boolean, int\|false given.#'

psalm.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="4"
4+
resolveFromConfigFile="true"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
>
9+
<projectFiles>
10+
<directory name="src" />
11+
</projectFiles>
12+
</psalm>

0 commit comments

Comments
 (0)