Skip to content

Commit

Permalink
Closures that use $this should not be static
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Jan 23, 2023
1 parent 70f2fb7 commit bfce3a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Psalm/Internal/LanguageServer/Client/TextDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function xcontent(TextDocumentIdentifier $textDocument): Promise
/**
* @return Generator<int, Promise<object>, object, TextDocumentItem>
*/
static function () use ($textDocument) {
function () use ($textDocument) {
/** @var Promise<object> */
$promise = $this->handler->request(
'textDocument/xcontent',
Expand Down
4 changes: 2 additions & 2 deletions src/Psalm/Internal/LanguageServer/ClientHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function request(string $method, $params): Promise
/**
* @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),
Expand All @@ -58,7 +58,7 @@ static function () use ($id, $method, $params): Generator {
$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
Expand Down

0 comments on commit bfce3a4

Please sign in to comment.