1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Closures that use $this should not be static

This commit is contained in:
Bruce Weirdan 2023-01-23 05:47:11 -04:00
parent 70f2fb7d1b
commit bfce3a41e4
No known key found for this signature in database
GPG Key ID: CFC3AAB181751B0D
2 changed files with 3 additions and 3 deletions

View File

@ -58,7 +58,7 @@ class TextDocument
/**
* @return Generator<int, Promise<object>, object, TextDocumentItem>
*/
static function () use ($textDocument) {
function () use ($textDocument) {
/** @var Promise<object> */
$promise = $this->handler->request(
'textDocument/xcontent',

View File

@ -48,7 +48,7 @@ class ClientHandler
/**
* @return Generator<int, Promise, mixed, Promise<mixed>>
*/
static function () use ($id, $method, $params): Generator {
function () use ($id, $method, $params): Generator {
yield $this->protocolWriter->write(
new Message(
new Request($id, $method, (object) $params),
@ -58,7 +58,7 @@ class ClientHandler
$deferred = new Deferred();
$listener =
static function (Message $msg) use ($id, $deferred, &$listener): void {
function (Message $msg) use ($id, $deferred, &$listener): void {
error_log('request handler');
/**
* @psalm-suppress UndefinedPropertyFetch