Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ea25caa

Browse files
Fix UsageOfDeprecatedCastRule - it reported all casts, not just (string)
1 parent 9d8e7d4 commit ea25caa

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

‎src/Rules/Deprecations/UsageOfDeprecatedCastRule.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use function sprintf;
1111

1212
/**
13-
* @implements Rule<Cast>
13+
* @implements Rule<Cast\String_>
1414
*/
1515
class UsageOfDeprecatedCastRule implements Rule
1616
{
@@ -24,7 +24,7 @@ public function __construct(DeprecatedScopeHelper $deprecatedScopeHelper)
2424

2525
public function getNodeType(): string
2626
{
27-
return Cast::class;
27+
return Cast\String_::class;
2828
}
2929

3030
public function processNode(Node $node, Scope $scope): array

‎tests/Rules/Deprecations/data/usage-of-deprecated-cast.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ function deprecatedScope(Foo $foo): string
2424
{
2525
return (string) $foo;
2626
}
27+
28+
function foo2(Foo $foo): string {
29+
return (int) $foo;
30+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /