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 5
5
namespace mglaman \PHPStanDrupal \Tests \DeprecatedScope ;
6
6
7
7
use mglaman \PHPStanDrupal \Tests \DrupalRuleTestCase ;
8
- use PHPStan \Rules \Deprecations \CallToDeprecatedFunctionRule ;
9
- use PHPStan \Rules \Deprecations \DeprecatedScopeHelper ;
8
+ use PHPStan \Rules \RestrictedUsage \RestrictedFunctionUsageRule ;
10
9
use PHPStan \Rules \Rule ;
11
10
12
11
final class DeprecationHelperScopeTest extends DrupalRuleTestCase {
13
12
14
13
protected function getRule (): Rule
15
14
{
16
15
/** @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);
22
17
}
23
18
24
19
public function testCustomScope (): void
Original file line number Diff line number Diff line change 5
5
namespace mglaman \PHPStanDrupal \Tests \DeprecatedScope ;
6
6
7
7
use mglaman \PHPStanDrupal \Tests \DrupalRuleTestCase ;
8
- use PHPStan \Rules \Deprecations \CallToDeprecatedFunctionRule ;
9
- use PHPStan \Rules \Deprecations \DeprecatedScopeHelper ;
8
+ use PHPStan \Rules \RestrictedUsage \RestrictedFunctionUsageRule ;
10
9
use PHPStan \Rules \Rule ;
11
10
12
11
final class GlobalLegacyScopeTest extends DrupalRuleTestCase {
13
12
14
13
protected function getRule (): Rule
15
14
{
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);
22
16
}
23
17
24
18
public function testCustomScope (): void
Original file line number Diff line number Diff line change 5
5
namespace mglaman \PHPStanDrupal \Tests \DeprecatedScope ;
6
6
7
7
use mglaman \PHPStanDrupal \Tests \DrupalRuleTestCase ;
8
- use PHPStan \Rules \Deprecations \CallToDeprecatedFunctionRule ;
9
- use PHPStan \Rules \Deprecations \DeprecatedScopeHelper ;
8
+ use PHPStan \Rules \RestrictedUsage \RestrictedFunctionUsageRule ;
10
9
use PHPStan \Rules \Rule ;
11
10
use PHPUnit \Framework \Attributes \IgnoreDeprecations ;
12
11
13
12
final class IgnoreDeprecationsScopeTest extends DrupalRuleTestCase {
14
13
15
14
protected function getRule (): Rule
16
15
{
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);
23
17
}
24
18
25
19
public function testCustomScope (): void
Original file line number Diff line number Diff line change 5
5
namespace mglaman \PHPStanDrupal \Tests \Rules ;
6
6
7
7
use mglaman \PHPStanDrupal \Tests \DrupalRuleTestCase ;
8
- use PHPStan \Rules \Deprecations \CallToDeprecatedMethodRule ;
9
- use PHPStan \Rules \Deprecations \DeprecatedScopeHelper ;
8
+ use PHPStan \Rules \RestrictedUsage \RestrictedMethodUsageRule ;
10
9
use PHPStan \Rules \Rule ;
11
10
12
11
final class RevisionableStorageInterfaceStubTest extends DrupalRuleTestCase
@@ -15,11 +14,7 @@ final class RevisionableStorageInterfaceStubTest extends DrupalRuleTestCase
15
14
protected function getRule (): Rule
16
15
{
17
16
/** @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);
23
18
}
24
19
25
20
public function testRule (): void
You can’t perform that action at this time.
0 commit comments