diff --git a/.travis.yml b/.travis.yml index 16578c6..27e83fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,10 @@ matrix: php: 7.3 env: DEPENDENCIES="roave/backward-compatibility-check" script: ./vendor/bin/roave-backward-compatibility-check || true + - name: PHPStan + php: 7.2 + env: DEPENDENCIES="phpstan/phpstan phpstan/phpstan-webmozart-assert" + script: ./vendor/bin/phpstan analyse src before_install: - if [[ "$PREFER_COVERAGE" = true ]] && [[ "$TRAVIS_PULL_REQUEST" = false ]]; then TEST_COMMAND="composer test-coverage" COVERAGE=true; fi diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..0ae4ea2 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + level: 5 + +includes: + - vendor/phpstan/phpstan-webmozart-assert/extension.neon diff --git a/src/Api/HttpApi.php b/src/Api/HttpApi.php index 31ed4fb..d63a90d 100644 --- a/src/Api/HttpApi.php +++ b/src/Api/HttpApi.php @@ -34,7 +34,7 @@ abstract class HttpApi protected $httpClient; /** - * @var null|Hydrator + * @var Hydrator|null */ protected $hydrator; diff --git a/src/Mailgun.php b/src/Mailgun.php index eeaf74f..04cacbb 100644 --- a/src/Mailgun.php +++ b/src/Mailgun.php @@ -25,7 +25,7 @@ use Psr\Http\Message\ResponseInterface; final class Mailgun { /** - * @var null|string + * @var string|null */ private $apiKey; diff --git a/src/Model/Tag/CountryResponse.php b/src/Model/Tag/CountryResponse.php index d650d2c..aae3b7c 100644 --- a/src/Model/Tag/CountryResponse.php +++ b/src/Model/Tag/CountryResponse.php @@ -1,5 +1,7 @@