Skip to content

Commit 151d71b

Browse files
committed
Rewrite in backward compatibility compliant way
1 parent 82b919a commit 151d71b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: tests/Rules/PHPUnit/AssertSameMethodDifferentTypesRuleTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace PHPStan\Rules\PHPUnit;
44

5-
use PHPStan\Rules\Comparison\ImpossibleCheckTypeHelper;
65
use PHPStan\Rules\Comparison\ImpossibleCheckTypeMethodCallRule;
76
use PHPStan\Rules\Rule;
87

@@ -14,7 +13,7 @@ class AssertSameMethodDifferentTypesRuleTest extends \PHPStan\Testing\RuleTestCa
1413

1514
protected function getRule(): Rule
1615
{
17-
return new ImpossibleCheckTypeMethodCallRule(new ImpossibleCheckTypeHelper($this->createBroker(), $this->getTypeSpecifier(), [], true), true, true);
16+
return self::getContainer()->getByType(ImpossibleCheckTypeMethodCallRule::class);
1817
}
1918

2019
public function testRule(): void
@@ -70,6 +69,7 @@ public static function getAdditionalConfigFiles(): array
7069
{
7170
return [
7271
__DIR__ . '/../../../extension.neon',
72+
__DIR__ . '/../../../vendor/phpstan/phpstan-strict-rules/rules.neon',
7373
];
7474
}
7575

Diff for: tests/Rules/PHPUnit/AssertSameStaticMethodDifferentTypesRuleTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace PHPStan\Rules\PHPUnit;
44

5-
use PHPStan\Rules\Comparison\ImpossibleCheckTypeHelper;
65
use PHPStan\Rules\Comparison\ImpossibleCheckTypeStaticMethodCallRule;
76
use PHPStan\Rules\Rule;
87

@@ -14,7 +13,7 @@ class AssertSameStaticMethodDifferentTypesRuleTest extends \PHPStan\Testing\Rule
1413

1514
protected function getRule(): Rule
1615
{
17-
return new ImpossibleCheckTypeStaticMethodCallRule(new ImpossibleCheckTypeHelper($this->createBroker(), $this->getTypeSpecifier(), [], true), true, true);
16+
return self::getContainer()->getByType(ImpossibleCheckTypeStaticMethodCallRule::class);
1817
}
1918

2019
public function testRule(): void
@@ -54,6 +53,7 @@ public static function getAdditionalConfigFiles(): array
5453
{
5554
return [
5655
__DIR__ . '/../../../extension.neon',
56+
__DIR__ . '/../../../vendor/phpstan/phpstan-strict-rules/rules.neon',
5757
];
5858
}
5959

0 commit comments

Comments
 (0)