mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix falsable issues with json_encode
This commit is contained in:
parent
f6d4a98063
commit
276a25de92
@ -159,7 +159,7 @@ class LanguageClient
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @var array */
|
/** @var array */
|
||||||
$array = json_decode(json_encode($config), true);
|
$array = json_decode((string) json_encode($config), true);
|
||||||
|
|
||||||
if (isset($array['hideWarnings'])) {
|
if (isset($array['hideWarnings'])) {
|
||||||
$this->clientConfiguration->hideWarnings = (bool) $array['hideWarnings'];
|
$this->clientConfiguration->hideWarnings = (bool) $array['hideWarnings'];
|
||||||
|
@ -843,7 +843,7 @@ class LanguageServer extends Dispatcher
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($context)) {
|
if (!empty($context)) {
|
||||||
$message .= "\n" . json_encode($context, JSON_PRETTY_PRINT);
|
$message .= "\n" . (string) json_encode($context, JSON_PRETTY_PRINT);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$this->client->logMessage(
|
$this->client->logMessage(
|
||||||
|
@ -350,7 +350,7 @@ class InternalCallMapHandlerTest extends TestCase
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
yield "$function: " . json_encode($entry) => [$function, $entry];
|
yield "$function: " . (string) json_encode($entry) => [$function, $entry];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user