diff --git a/.gitignore b/.gitignore index ae8b6cbc0..c7648c5d2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ *.phar /composer.lock /vendor +/phpstan.neon /phpunit.xml /.phpunit.result.cache diff --git a/composer.json b/composer.json index 249c5413e..1f4bff1a7 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "phpspec/prophecy", "description": "Highly opinionated mocking framework for PHP 5.3+", - "keywords": ["Mock", "Stub", "Dummy", "Double", "Fake", "Spy"], + "keywords": ["Mock", "Stub", "Dummy", "Double", "Fake", "Spy", "dev"], "homepage": "https://github.com/phpspec/prophecy", "type": "library", "license": "MIT", @@ -44,6 +44,16 @@ } }, + "scripts": { + "phpstan": "phpstan analyse", + "phpstan:baseline": "phpstan analyse --generate-baseline" + }, + + "scripts-descriptions": { + "phpstan": "Run PHPStan analysis", + "phpstan:baseline": "Dump PHPStan baseline file - use only for updating, do not add new errors when possible" + }, + "extra": { "branch-alias": { "dev-master": "1.x-dev" diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index ff18eff5f..52470f1fa 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -35,6 +35,16 @@ parameters: count: 1 path: src/Prophecy/Doubler/Doubler.php + - + message: "#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(ReflectionIntersectionType\\|ReflectionNamedType\\|string\\)\\: mixed\\)\\|null, Closure\\(string\\)\\: string given\\.$#" + count: 1 + path: src/Prophecy/Doubler/Generator/ClassMirror.php + + - + message: "#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(ReflectionIntersectionType\\|ReflectionNamedType\\)\\: mixed\\)\\|null, Closure\\(ReflectionNamedType\\)\\: string given\\.$#" + count: 1 + path: src/Prophecy/Prophecy/MethodProphecy.php + - message: "#^Unable to resolve the template type T in call to method Prophecy\\\\Prophet\\:\\:prophesize\\(\\)$#" count: 1 diff --git a/phpstan.neon b/phpstan.dist.neon similarity index 100% rename from phpstan.neon rename to phpstan.dist.neon