Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify ForbidNotNormalizedTypeRuleTest #243

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 1 addition & 26 deletions tests/Rule/ForbidNotNormalizedTypeRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@
namespace ShipMonk\PHPStan\Rule;

use PhpParser\PrettyPrinter\Standard;
use PHPStan\Broker\AnonymousClassNameHelper;
use PHPStan\File\FileHelper;
use PHPStan\PhpDoc\PhpDocNodeResolver;
use PHPStan\PhpDoc\PhpDocStringResolver;
use PHPStan\PhpDoc\TypeNodeResolver;
use PHPStan\PhpDocParser\Lexer\Lexer;
use PHPStan\PhpDocParser\Parser\ConstExprParser;
use PHPStan\PhpDocParser\Parser\PhpDocParser;
use PHPStan\PhpDocParser\Parser\TypeParser;
use PHPStan\Reflection\ReflectionProvider\ReflectionProviderProvider;
use PHPStan\Type\FileTypeMapper;
use ShipMonk\PHPStan\RuleTestCase;

Expand All @@ -25,23 +16,7 @@ class ForbidNotNormalizedTypeRuleTest extends RuleTestCase
protected function getRule(): ForbidNotNormalizedTypeRule
{
return new ForbidNotNormalizedTypeRule(
new FileTypeMapper( // @phpstan-ignore-line
self::getContainer()->getByType(ReflectionProviderProvider::class), // @phpstan-ignore-line
self::getContainer()->getService('currentPhpVersionRichParser'), // @phpstan-ignore-line
new PhpDocStringResolver( // @phpstan-ignore-line
new Lexer(),
new PhpDocParser(
self::getContainer()->getByType(TypeParser::class),
self::getContainer()->getByType(ConstExprParser::class),
false,
false,
['lines' => true], // simplify after https://github.com/phpstan/phpstan-src/pull/2807
),
),
self::getContainer()->getByType(PhpDocNodeResolver::class), // @phpstan-ignore-line
self::getContainer()->getByType(AnonymousClassNameHelper::class), // @phpstan-ignore-line
self::getContainer()->getByType(FileHelper::class),
),
self::getContainer()->getByType(FileTypeMapper::class),
self::getContainer()->getByType(TypeNodeResolver::class),
self::getContainer()->getByType(Standard::class),
true,
Expand Down
Loading