Skip to content

Commit 79abee3

Browse files
committed
Rewrite in backward compatibility compliant way
1 parent fbd7443 commit 79abee3

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

tests/Rules/Deprecations/AccessDeprecatedStaticPropertyRuleTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ class AccessDeprecatedStaticPropertyRuleTest extends \PHPStan\Testing\RuleTestCa
1313
protected function getRule(): \PHPStan\Rules\Rule
1414
{
1515
$broker = $this->createBroker();
16-
$ruleLevelHelper = new RuleLevelHelper($this->createBroker(), true, false, true);
1716

18-
return new AccessDeprecatedStaticPropertyRule($broker, $ruleLevelHelper);
17+
return new AccessDeprecatedStaticPropertyRule($broker, self::getContainer()->getByType(RuleLevelHelper::class));
1918
}
2019

2120
public function testAccessDeprecatedStaticProperty(): void

tests/Rules/Deprecations/CallToDeprecatedStaticMethodRuleTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ class CallToDeprecatedStaticMethodRuleTest extends \PHPStan\Testing\RuleTestCase
1313
protected function getRule(): \PHPStan\Rules\Rule
1414
{
1515
$broker = $this->createBroker();
16-
$ruleLevelHelper = new RuleLevelHelper($this->createBroker(), true, false, true);
1716

18-
return new CallToDeprecatedStaticMethodRule($broker, $ruleLevelHelper);
17+
return new CallToDeprecatedStaticMethodRule($broker, self::getContainer()->getByType(RuleLevelHelper::class));
1918
}
2019

2120
public function testDeprecatedStaticMethodCall(): void

tests/Rules/Deprecations/FetchingClassConstOfDeprecatedClassRuleTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ class FetchingClassConstOfDeprecatedClassRuleTest extends \PHPStan\Testing\RuleT
1313
protected function getRule(): \PHPStan\Rules\Rule
1414
{
1515
$broker = $this->createBroker();
16-
$ruleLevelHelper = new RuleLevelHelper($this->createBroker(), true, false, true);
1716

18-
return new FetchingClassConstOfDeprecatedClassRule($broker, $ruleLevelHelper);
17+
return new FetchingClassConstOfDeprecatedClassRule($broker, self::getContainer()->getByType(RuleLevelHelper::class));
1918
}
2019

2120
public function testFetchingClassConstOfDeprecatedClass(): void

tests/Rules/Deprecations/InstantiationOfDeprecatedClassRuleTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ class InstantiationOfDeprecatedClassRuleTest extends \PHPStan\Testing\RuleTestCa
1313
protected function getRule(): \PHPStan\Rules\Rule
1414
{
1515
$broker = $this->createBroker();
16-
$ruleLevelHelper = new RuleLevelHelper($this->createBroker(), true, false, true);
1716

18-
return new InstantiationOfDeprecatedClassRule($broker, $ruleLevelHelper);
17+
return new InstantiationOfDeprecatedClassRule($broker, self::getContainer()->getByType(RuleLevelHelper::class));
1918
}
2019

2120
public function testInstantiationOfDeprecatedClass(): void

0 commit comments

Comments
 (0)