Skip to content

Commit

Permalink
put test out of global namspace
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Oct 8, 2024
1 parent 08ca712 commit a775e37
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3422,7 +3422,7 @@ public function testBug11559c(): void
$this->analyse([__DIR__ . '/data/bug-11559c.php'], [
[
'Method class@anonymous/tests/PHPStan/Rules/Methods/data/bug-11559c.php:5:1::regular_fn() invoked with 3 parameters, 1 required.',
14,
15,
],
]);
}
Expand Down
20 changes: 11 additions & 9 deletions tests/PHPStan/Rules/Methods/data/bug-11559c.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

namespace Bug11559c;

$c = new class (new class {}) {
function implicit_variadic_fn() {
$args = func_get_args();
}
function regular_fn(int $i) {
}
};
function doFoo() {
$c = new class (new class {}) {
function implicit_variadic_fn() {
$args = func_get_args();
}
function regular_fn(int $i) {
}
};

$c->implicit_variadic_fn(1, 2, 3);
$c->regular_fn(1, 2, 3);
$c->implicit_variadic_fn(1, 2, 3);
$c->regular_fn(1, 2, 3);
}

0 comments on commit a775e37

Please sign in to comment.