You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0f06587
Browse filesBrowse the repository at this point in the historyBrowse files
Run the NoDiscard rule tests wherever their syntax parses
76f47dd dropped the PHP 8.5 requirement from the three NoDiscard rule
tests, but their fixtures still use the pipe operator and the (void) cast,
which are PHP 8.5 syntax - on the PHP 7.4 job the pipe token cannot even be
lexed. Each fixture is split: the plain calls stay in the original file
and run on every PHP with attributes (7.4 reads #[\NoDiscard] as a comment,
so nothing would be reported there), the (void) casts and pipes move to a
-php85 fixture behind #[RequiresPhp('>= 8.5.0')].
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DfQHLTyyoMfjfa4sXJCGa5
@@ -39,27 +42,35 @@ public function testRule(): void
39
42
],
40
43
[
41
44
'Call to static method StaticMethodCallStatementResultDiscarded\ClassWithStaticSideEffects::differentCase() on a separate line discards return value.',
42
-
27,
45
+
25,
43
46
],
47
+
]);
48
+
}
49
+
50
+
// the (void) cast and the pipe operator are PHP 8.5 syntax
'Call to static method StaticMethodCallStatementResultDiscarded\Foo::canDiscard() in (void) cast but method allows discarding return value.',
46
-
41,
56
+
'Call to static method StaticMethodCallStatementResultDiscardedPhp85\Foo::canDiscard() in (void) cast but method allows discarding return value.',
57
+
23,
47
58
],
48
59
[
49
-
'Call to static method StaticMethodCallStatementResultDiscarded\ClassWithStaticSideEffects::staticMethod() on a separate line discards return value.',
50
-
43,
60
+
'Call to static method StaticMethodCallStatementResultDiscardedPhp85\ClassWithStaticSideEffects::staticMethod() on a separate line discards return value.',
61
+
25,
51
62
],
52
63
[
53
-
'Call to static method StaticMethodCallStatementResultDiscarded\Foo::canDiscard() in (void) cast but method allows discarding return value.',
54
-
46,
64
+
'Call to static method StaticMethodCallStatementResultDiscardedPhp85\Foo::canDiscard() in (void) cast but method allows discarding return value.',
65
+
28,
55
66
],
56
67
[
57
-
'Call to static method StaticMethodCallStatementResultDiscarded\ClassWithStaticSideEffects::staticMethod() on a separate line discards return value.',
58
-
48,
68
+
'Call to static method StaticMethodCallStatementResultDiscardedPhp85\ClassWithStaticSideEffects::staticMethod() on a separate line discards return value.',
69
+
30,
59
70
],
60
71
[
61
-
'Call to static method StaticMethodCallStatementResultDiscarded\Foo::canDiscard() in (void) cast but method allows discarding return value.',
62
-
51,
72
+
'Call to static method StaticMethodCallStatementResultDiscardedPhp85\Foo::canDiscard() in (void) cast but method allows discarding return value.',
0 commit comments