Skip to content

Commit

Permalink
Rewrite in backward compatibility compliant way
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jun 9, 2021
1 parent fbd7443 commit 79abee3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ class AccessDeprecatedStaticPropertyRuleTest extends \PHPStan\Testing\RuleTestCa
protected function getRule(): \PHPStan\Rules\Rule
{
$broker = $this->createBroker();
$ruleLevelHelper = new RuleLevelHelper($this->createBroker(), true, false, true);

return new AccessDeprecatedStaticPropertyRule($broker, $ruleLevelHelper);
return new AccessDeprecatedStaticPropertyRule($broker, self::getContainer()->getByType(RuleLevelHelper::class));
}

public function testAccessDeprecatedStaticProperty(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ class CallToDeprecatedStaticMethodRuleTest extends \PHPStan\Testing\RuleTestCase
protected function getRule(): \PHPStan\Rules\Rule
{
$broker = $this->createBroker();
$ruleLevelHelper = new RuleLevelHelper($this->createBroker(), true, false, true);

return new CallToDeprecatedStaticMethodRule($broker, $ruleLevelHelper);
return new CallToDeprecatedStaticMethodRule($broker, self::getContainer()->getByType(RuleLevelHelper::class));
}

public function testDeprecatedStaticMethodCall(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ class FetchingClassConstOfDeprecatedClassRuleTest extends \PHPStan\Testing\RuleT
protected function getRule(): \PHPStan\Rules\Rule
{
$broker = $this->createBroker();
$ruleLevelHelper = new RuleLevelHelper($this->createBroker(), true, false, true);

return new FetchingClassConstOfDeprecatedClassRule($broker, $ruleLevelHelper);
return new FetchingClassConstOfDeprecatedClassRule($broker, self::getContainer()->getByType(RuleLevelHelper::class));
}

public function testFetchingClassConstOfDeprecatedClass(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ class InstantiationOfDeprecatedClassRuleTest extends \PHPStan\Testing\RuleTestCa
protected function getRule(): \PHPStan\Rules\Rule
{
$broker = $this->createBroker();
$ruleLevelHelper = new RuleLevelHelper($this->createBroker(), true, false, true);

return new InstantiationOfDeprecatedClassRule($broker, $ruleLevelHelper);
return new InstantiationOfDeprecatedClassRule($broker, self::getContainer()->getByType(RuleLevelHelper::class));
}

public function testInstantiationOfDeprecatedClass(): void
Expand Down

0 comments on commit 79abee3

Please sign in to comment.