Skip to content

Commit 4f7b2ff

Browse files
authored
Merge branch 'main' into 2.x-formatter-generic
2 parents 5382f35 + a102eea commit 4f7b2ff

File tree

4 files changed

+8
-30
lines changed

4 files changed

+8
-30
lines changed

tests/src/DeprecatedScope/DeprecationHelperScopeTest.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,15 @@
55
namespace mglaman\PHPStanDrupal\Tests\DeprecatedScope;
66

77
use mglaman\PHPStanDrupal\Tests\DrupalRuleTestCase;
8-
use PHPStan\Rules\Deprecations\CallToDeprecatedFunctionRule;
9-
use PHPStan\Rules\Deprecations\DeprecatedScopeHelper;
8+
use PHPStan\Rules\RestrictedUsage\RestrictedFunctionUsageRule;
109
use PHPStan\Rules\Rule;
1110

1211
final 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

tests/src/DeprecatedScope/GlobalLegacyScopeTest.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,14 @@
55
namespace mglaman\PHPStanDrupal\Tests\DeprecatedScope;
66

77
use mglaman\PHPStanDrupal\Tests\DrupalRuleTestCase;
8-
use PHPStan\Rules\Deprecations\CallToDeprecatedFunctionRule;
9-
use PHPStan\Rules\Deprecations\DeprecatedScopeHelper;
8+
use PHPStan\Rules\RestrictedUsage\RestrictedFunctionUsageRule;
109
use PHPStan\Rules\Rule;
1110

1211
final 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

tests/src/DeprecatedScope/IgnoreDeprecationsScopeTest.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,15 @@
55
namespace mglaman\PHPStanDrupal\Tests\DeprecatedScope;
66

77
use mglaman\PHPStanDrupal\Tests\DrupalRuleTestCase;
8-
use PHPStan\Rules\Deprecations\CallToDeprecatedFunctionRule;
9-
use PHPStan\Rules\Deprecations\DeprecatedScopeHelper;
8+
use PHPStan\Rules\RestrictedUsage\RestrictedFunctionUsageRule;
109
use PHPStan\Rules\Rule;
1110
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1211

1312
final 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

tests/src/Rules/RevisionableStorageInterfaceStubTest.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
namespace mglaman\PHPStanDrupal\Tests\Rules;
66

77
use mglaman\PHPStanDrupal\Tests\DrupalRuleTestCase;
8-
use PHPStan\Rules\Deprecations\CallToDeprecatedMethodRule;
9-
use PHPStan\Rules\Deprecations\DeprecatedScopeHelper;
8+
use PHPStan\Rules\RestrictedUsage\RestrictedMethodUsageRule;
109
use PHPStan\Rules\Rule;
1110

1211
final 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

0 commit comments

Comments
 (0)