Skip to content

Commit

Permalink
Analyze the tests too
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Dec 14, 2019
1 parent 7ab0ff4 commit 0176075
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/.gitignore export-ignore
/.travis.yml export-ignore
/phpstan.neon.dist export-ignore
/phpstan.tests.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore
/UPGRADING.md export-ignore
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
composer.lock
phpstan.neon
phpstan.tests.neon
phpunit.xml
vendor
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ matrix:
install:
- 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
- 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
script: docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan registry.gitlab.com/grahamcampbell/php:7.4 analyse src
script:
- docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan registry.gitlab.com/grahamcampbell/php:7.4 analyse src
- 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
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"require": {
"php": "^5.5.9 || ^7.0",
"phpoption/phpoption": "^1.7",
"phpoption/phpoption": "^1.7.1",
"symfony/polyfill-ctype": "^1.9"
},
"require-dev": {
Expand All @@ -29,6 +29,11 @@
"Dotenv\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Dotenv\\Tests\\": "tests/Dotenv/"
}
},
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
Expand Down
4 changes: 4 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ parameters:
- '#Method Dotenv\\Loader\\Lines::getCharPairs\(\) should return array\(array\(string, string\|null\)\) but returns array\<int, mixed\>.#'
- '#Unable to resolve the template type S in call to method PhpOption\\Option<mixed>::flatMap\(\)#'
- '#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>.#'
- '#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.#'
- '#Parameter \#1 \$callable of method PhpOption\\Option<array\|null>::[a-z]+\(\) expects callable\(array\|null\): [a-z]+, Closure\(array\): mixed given.#'
- '#Method Dotenv\\Repository\\Adapter\\PutenvAdapter::get\(\) should return PhpOption\\Option<string> but returns PhpOption\\Option<bool\|string>.#'
- '#Method Dotenv\\Store\\File\\Reader::readFromFile\(\) should return PhpOption\\Option<string> but returns PhpOption\\Option<bool\|string>.#'
4 changes: 4 additions & 0 deletions phpstan.tests.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parameters:
level: 5
ignoreErrors:
- '#Parameter \#1 \$name of method Dotenv\\Repository\\RepositoryInterface::[a-z]+\(\) expects string, [a-z]+ given.#'
2 changes: 2 additions & 0 deletions tests/Dotenv/DotenvTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Dotenv\Tests;

use Dotenv\Dotenv;
use Dotenv\Loader\Loader;
use Dotenv\Repository\RepositoryBuilder;
Expand Down
2 changes: 2 additions & 0 deletions tests/Dotenv/LinesTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Dotenv\Tests;

use Dotenv\Loader\Lines;
use PHPUnit\Framework\TestCase;

Expand Down
2 changes: 2 additions & 0 deletions tests/Dotenv/LoaderTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Dotenv\Tests;

use Dotenv\Loader\Loader;
use Dotenv\Repository\Adapter\ArrayAdapter;
use Dotenv\Repository\Adapter\EnvConstAdapter;
Expand Down
2 changes: 2 additions & 0 deletions tests/Dotenv/ParserTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Dotenv\Tests;

use Dotenv\Loader\Parser;
use PHPUnit\Framework\TestCase;

Expand Down
3 changes: 2 additions & 1 deletion tests/Dotenv/RepositoryTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

<?php

namespace Dotenv\Tests;

use Dotenv\Dotenv;
use Dotenv\Repository\Adapter\ArrayAdapter;
use Dotenv\Repository\RepositoryBuilder;
Expand Down
2 changes: 2 additions & 0 deletions tests/Dotenv/ResultTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Dotenv\Tests;

use Dotenv\Result\Error;
use Dotenv\Result\Success;
use PHPUnit\Framework\TestCase;
Expand Down
2 changes: 2 additions & 0 deletions tests/Dotenv/StoreTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Dotenv\Tests;

use Dotenv\Store\File\Paths;
use Dotenv\Store\File\Reader;
use Dotenv\Store\StoreBuilder;
Expand Down
2 changes: 2 additions & 0 deletions tests/Dotenv/ValidatorTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Dotenv\Tests;

use Dotenv\Dotenv;
use PHPUnit\Framework\TestCase;

Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/phpstan/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"require": {
"phpstan/phpstan": "^0.12.2"
"phpstan/phpstan": "^0.12.3"
}
}

0 comments on commit 0176075

Please sign in to comment.