diff --git a/.travis.yml b/.travis.yml index a4bb07c8..d75df92c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,3 +53,7 @@ jobs: - if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi script: - ./vendor/bin/humbug + + - stage: Static analysis + script: + - ./vendor/bin/phpstan analyse -c phpstan.neon -l max src test diff --git a/composer.json b/composer.json index 18b11d96..9377e297 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,7 @@ "require-dev": { "humbug/humbug": "dev-master@dev", "mikey179/vfsStream": "^1.6", + "phpstan/phpstan": "^0.9.0@dev", "phpunit/phpunit": "^6.4", "squizlabs/php_codesniffer": "^3.1", "symfony/proxy-manager-bridge": "^3.3|^4.0", diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000..dd22965e --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + ignoreErrors: + # Ignore PHPUnit mock stuff + - '#PHPUnit_Framework_MockObject_MockObject.* given#' + - '#does not accept PHPUnit_Framework_MockObject_MockObject#' diff --git a/test/Config/ContainerConfigurationTest.php b/test/Config/ContainerConfigurationTest.php index 00609f15..098bb66f 100644 --- a/test/Config/ContainerConfigurationTest.php +++ b/test/Config/ContainerConfigurationTest.php @@ -11,7 +11,7 @@ final class ContainerConfigurationTest extends \PHPUnit\Framework\TestCase { /** - * @var CompilerPassInterface + * @var CompilerPassInterface|\PHPUnit_Framework_MockObject_MockObject */ private $pass;