Skip to content

Commit 0176075

Browse files
Analyze the tests too
1 parent 7ab0ff4 commit 0176075

15 files changed

+36
-4
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/.gitignore export-ignore
77
/.travis.yml export-ignore
88
/phpstan.neon.dist export-ignore
9+
/phpstan.tests.neon.dist export-ignore
910
/phpunit.xml.dist export-ignore
1011
/README.md export-ignore
1112
/UPGRADING.md export-ignore

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
composer.lock
22
phpstan.neon
3+
phpstan.tests.neon
34
phpunit.xml
45
vendor

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@ matrix:
4141
install:
4242
- travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:7.4 install --no-suggest --prefer-dist -n -o
4343
- travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:7.4 bin phpstan install --no-suggest --prefer-dist -n -o
44-
script: docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan registry.gitlab.com/grahamcampbell/php:7.4 analyse src
44+
script:
45+
- docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan registry.gitlab.com/grahamcampbell/php:7.4 analyse src
46+
- docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan registry.gitlab.com/grahamcampbell/php:7.4 analyse tests -c phpstan.tests.neon.dist

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"require": {
1919
"php": "^5.5.9 || ^7.0",
20-
"phpoption/phpoption": "^1.7",
20+
"phpoption/phpoption": "^1.7.1",
2121
"symfony/polyfill-ctype": "^1.9"
2222
},
2323
"require-dev": {
@@ -29,6 +29,11 @@
2929
"Dotenv\\": "src/"
3030
}
3131
},
32+
"autoload-dev": {
33+
"psr-4": {
34+
"Dotenv\\Tests\\": "tests/Dotenv/"
35+
}
36+
},
3237
"extra": {
3338
"branch-alias": {
3439
"dev-master": "4.1-dev"

phpstan.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ parameters:
1010
- '#Method Dotenv\\Loader\\Lines::getCharPairs\(\) should return array\(array\(string, string\|null\)\) but returns array\<int, mixed\>.#'
1111
- '#Unable to resolve the template type S in call to method PhpOption\\Option<mixed>::flatMap\(\)#'
1212
- '#Method Dotenv\\Loader\\Parser::processChar\(\) should return Dotenv\\Result\\Result<array<int, bool\|int\|string>, string> but returns Dotenv\\Result\\Result<array<int, [a-z\|\,]+>, mixed>.#'
13+
- '#Parameter \#1 \$callable of method PhpOption\\Option<Dotenv\\Loader\\Value|null>::map\(\) expects callable\(Dotenv\\Loader\\Value\|null\): mixed, Closure\(Dotenv\\Loader\\Value\): mixed given.#'
14+
- '#Parameter \#1 \$callable of method PhpOption\\Option<array\|null>::[a-z]+\(\) expects callable\(array\|null\): [a-z]+, Closure\(array\): mixed given.#'
15+
- '#Method Dotenv\\Repository\\Adapter\\PutenvAdapter::get\(\) should return PhpOption\\Option<string> but returns PhpOption\\Option<bool\|string>.#'
16+
- '#Method Dotenv\\Store\\File\\Reader::readFromFile\(\) should return PhpOption\\Option<string> but returns PhpOption\\Option<bool\|string>.#'

phpstan.tests.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 5
3+
ignoreErrors:
4+
- '#Parameter \#1 \$name of method Dotenv\\Repository\\RepositoryInterface::[a-z]+\(\) expects string, [a-z]+ given.#'

tests/Dotenv/DotenvTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
namespace Dotenv\Tests;
4+
35
use Dotenv\Dotenv;
46
use Dotenv\Loader\Loader;
57
use Dotenv\Repository\RepositoryBuilder;

tests/Dotenv/LinesTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
namespace Dotenv\Tests;
4+
35
use Dotenv\Loader\Lines;
46
use PHPUnit\Framework\TestCase;
57

tests/Dotenv/LoaderTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
namespace Dotenv\Tests;
4+
35
use Dotenv\Loader\Loader;
46
use Dotenv\Repository\Adapter\ArrayAdapter;
57
use Dotenv\Repository\Adapter\EnvConstAdapter;

tests/Dotenv/ParserTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
namespace Dotenv\Tests;
4+
35
use Dotenv\Loader\Parser;
46
use PHPUnit\Framework\TestCase;
57

0 commit comments

Comments
 (0)