File tree Expand file tree Collapse file tree 4 files changed +8
-30
lines changed Expand file tree Collapse file tree 4 files changed +8
-30
lines changed Original file line number Diff line number Diff line change 55namespace mglaman \PHPStanDrupal \Tests \DeprecatedScope ;
66
77use mglaman \PHPStanDrupal \Tests \DrupalRuleTestCase ;
8- use PHPStan \Rules \Deprecations \CallToDeprecatedFunctionRule ;
9- use PHPStan \Rules \Deprecations \DeprecatedScopeHelper ;
8+ use PHPStan \Rules \RestrictedUsage \RestrictedFunctionUsageRule ;
109use PHPStan \Rules \Rule ;
1110
1211final class DeprecationHelperScopeTest extends DrupalRuleTestCase {
1312
1413 protected function getRule (): Rule
1514 {
1615 /** @phpstan-ignore phpstanApi.constructor */
17- return new CallToDeprecatedFunctionRule (
18- self ::createReflectionProvider (),
19- /** @phpstan-ignore phpstanApi.classConstant */
20- self ::getContainer ()->getByType (DeprecatedScopeHelper::class)
21- );
16+ return self ::getContainer ()->getByType (RestrictedFunctionUsageRule::class);
2217 }
2318
2419 public function testCustomScope (): void
Original file line number Diff line number Diff line change 55namespace mglaman \PHPStanDrupal \Tests \DeprecatedScope ;
66
77use mglaman \PHPStanDrupal \Tests \DrupalRuleTestCase ;
8- use PHPStan \Rules \Deprecations \CallToDeprecatedFunctionRule ;
9- use PHPStan \Rules \Deprecations \DeprecatedScopeHelper ;
8+ use PHPStan \Rules \RestrictedUsage \RestrictedFunctionUsageRule ;
109use PHPStan \Rules \Rule ;
1110
1211final class GlobalLegacyScopeTest extends DrupalRuleTestCase {
1312
1413 protected function getRule (): Rule
1514 {
16- /** @phpstan-ignore phpstanApi.constructor */
17- return new CallToDeprecatedFunctionRule (
18- self ::createReflectionProvider (),
19- /** @phpstan-ignore phpstanApi.classConstant */
20- self ::getContainer ()->getByType (DeprecatedScopeHelper::class)
21- );
15+ return self ::getContainer ()->getByType (RestrictedFunctionUsageRule::class);
2216 }
2317
2418 public function testCustomScope (): void
Original file line number Diff line number Diff line change 55namespace mglaman \PHPStanDrupal \Tests \DeprecatedScope ;
66
77use mglaman \PHPStanDrupal \Tests \DrupalRuleTestCase ;
8- use PHPStan \Rules \Deprecations \CallToDeprecatedFunctionRule ;
9- use PHPStan \Rules \Deprecations \DeprecatedScopeHelper ;
8+ use PHPStan \Rules \RestrictedUsage \RestrictedFunctionUsageRule ;
109use PHPStan \Rules \Rule ;
1110use PHPUnit \Framework \Attributes \IgnoreDeprecations ;
1211
1312final class IgnoreDeprecationsScopeTest extends DrupalRuleTestCase {
1413
1514 protected function getRule (): Rule
1615 {
17- /** @phpstan-ignore phpstanApi.constructor */
18- return new CallToDeprecatedFunctionRule (
19- self ::createReflectionProvider (),
20- /** @phpstan-ignore phpstanApi.classConstant */
21- self ::getContainer ()->getByType (DeprecatedScopeHelper::class)
22- );
16+ return self ::getContainer ()->getByType (RestrictedFunctionUsageRule::class);
2317 }
2418
2519 public function testCustomScope (): void
Original file line number Diff line number Diff line change 55namespace mglaman \PHPStanDrupal \Tests \Rules ;
66
77use mglaman \PHPStanDrupal \Tests \DrupalRuleTestCase ;
8- use PHPStan \Rules \Deprecations \CallToDeprecatedMethodRule ;
9- use PHPStan \Rules \Deprecations \DeprecatedScopeHelper ;
8+ use PHPStan \Rules \RestrictedUsage \RestrictedMethodUsageRule ;
109use PHPStan \Rules \Rule ;
1110
1211final class RevisionableStorageInterfaceStubTest extends DrupalRuleTestCase
@@ -15,11 +14,7 @@ final class RevisionableStorageInterfaceStubTest extends DrupalRuleTestCase
1514 protected function getRule (): Rule
1615 {
1716 /** @phpstan-ignore phpstanApi.constructor */
18- return new CallToDeprecatedMethodRule (
19- self ::createReflectionProvider (),
20- /** @phpstan-ignore phpstanApi.classConstant */
21- self ::getContainer ()->getByType (DeprecatedScopeHelper::class)
22- );
17+ return self ::getContainer ()->getByType (RestrictedMethodUsageRule::class);
2318 }
2419
2520 public function testRule (): void
You can’t perform that action at this time.
0 commit comments