Skip to content

Commit

Permalink
fix: usage with latest phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Jul 1, 2024
1 parent bb23222 commit ce599ef
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"license": "MIT",
"require": {
"php": "^8.1",
"phpstan/phpstan": "^1.11.3",
"phpstan/phpstan": "^1.11.6",
"tomasvotruba/type-coverage": "^0.2.8",
"pestphp/pest-plugin": "^2.1.1"
},
Expand All @@ -25,7 +25,7 @@
}
},
"require-dev": {
"pestphp/pest": "^2.34.7",
"pestphp/pest": "^2.34.8",
"pestphp/pest-dev-tools": "^2.16.0"
},
"minimum-stability": "dev",
Expand Down
1 change: 0 additions & 1 deletion resources/phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# phpstan.neon
parameters:
type_coverage:
return_type: 100
Expand Down
2 changes: 2 additions & 0 deletions src/PHPStanAnalyser.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use PHPStan\DependencyInjection\Reflection\ClassReflectionExtensionRegistryProvider;
use PHPStan\DependencyInjection\Type\DynamicThrowTypeExtensionProvider;
use PHPStan\DependencyInjection\Type\ParameterClosureTypeExtensionProvider;
use PHPStan\DependencyInjection\Type\ParameterOutTypeExtensionProvider;
use PHPStan\File\FileHelper;
use PHPStan\Php\PhpVersion;
use PHPStan\PhpDoc\PhpDocInheritanceResolver;
Expand Down Expand Up @@ -55,6 +56,7 @@ public static function make(Container $container, array $rules, array $collector
$container->getByType(InitializerExprTypeResolver::class),
$container->getService('betterReflectionReflector'), // @phpstan-ignore-line
$container->getByType(ClassReflectionExtensionRegistryProvider::class),
$container->getByType(ParameterOutTypeExtensionProvider::class),
$container->getService('defaultAnalysisParser'), // @phpstan-ignore-line
$container->getByType(FileTypeMapper::class),
$container->getByType(StubPhpDocProvider::class),
Expand Down
2 changes: 1 addition & 1 deletion src/TestCaseForTypeCoverage.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function gatherAnalyserErrors(array $files): array
$analyser = PHPStanAnalyser::make(self::getContainer(), $this->getRules(), $this->getCollectors());
$analyserResult = $analyser->analyse($files, null, null, \true);
if ($analyserResult->getInternalErrors() !== []) {
self::fail(implode("\n", $analyserResult->getInternalErrors()));
self::fail(implode("\n", $analyserResult->getInternalErrors())); // @phpstan-ignore-line
}

$actualErrors = $analyserResult->getUnorderedErrors();
Expand Down

0 comments on commit ce599ef

Please # to comment.