Skip to content

Commit

Permalink
Simplify ForbidNotNormalizedTypeRuleTest (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal committed May 14, 2024
1 parent d3a6576 commit 604e277
Showing 1 changed file with 1 addition and 26 deletions.
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

0 comments on commit 604e277

Please sign in to comment.