Skip to content

Commit

Permalink
test with get_class($this)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Oct 13, 2021
1 parent de39d39 commit 88c36dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php
Expand Up @@ -867,7 +867,11 @@ public function testClosureBind(): void
],
[
'Call to an undefined method CallClosureBind\Foo::nonexistentMethod().',
44,
43,
],
[
'Call to an undefined method CallClosureBind\Foo::nonexistentMethod().',
49,
],
]);
}
Expand Down
5 changes: 5 additions & 0 deletions tests/PHPStan/Rules/Methods/data/closure-bind.php
Expand Up @@ -38,6 +38,11 @@ public function fooMethod(): Foo
$foo->nonexistentMethod();
}, null, get_class(new Foo()));

\Closure::bind(function (Foo $foo) {
$foo->privateMethod();
$foo->nonexistentMethod();
}, null, get_class($this));

\Closure::bind(function () {
// $this is Foo
$this->privateMethod();
Expand Down

0 comments on commit 88c36dd

Please sign in to comment.