Skip to content

Commit 0e5a89f

Browse files
committed
Fix: Add more test cases for CallLikes\NoNamedArgumentRule
1 parent 8c84b79 commit 0e5a89f

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

test/Fixture/CallLikes/NoNamedArgumentRule/script.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,19 @@ public static function create($bar = null): ExampleInterface
125125

126126
$invokableClass(1);
127127
$invokableClass(bar: 1);
128+
129+
$staticClassMethodCallable = [
130+
ExampleClass::class,
131+
'create'
132+
];
133+
134+
$staticClassMethodCallable(1);
135+
$staticClassMethodCallable(bar: 1);
136+
137+
$dynamicClassMethodCallable = [
138+
$exampleClass,
139+
'bar'
140+
];
141+
142+
$dynamicClassMethodCallable(1);
143+
$dynamicClassMethodCallable(bar: 1);

test/Integration/CallLikes/NoNamedArgumentRuleTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ public function testNoNamedArgumentRule(): void
192192
'Callable referenced by $invokableClass is invoked with named argument for parameter $bar.',
193193
127,
194194
],
195+
[
196+
'Callable referenced by $staticClassMethodCallable is invoked with named argument for parameter $bar.',
197+
135,
198+
],
199+
[
200+
'Callable referenced by $dynamicClassMethodCallable is invoked with named argument for parameter $bar.',
201+
143,
202+
],
195203
],
196204
);
197205
}

0 commit comments

Comments
 (0)