Skip to content

Commit

Permalink
@psalm-api
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-worman committed Dec 23, 2022
1 parent 352dbe1 commit cae973e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"phpunit"
],
"verify-callmap": "phpunit tests/Internal/Codebase/InternalCallMapHandlerTest.php",
"psalm": "@php ./psalm --no-cache -m",
"psalm": "@php ./psalm",
"tests": [
"@lint",
"@cs",
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
</testsuites>

<php>
<const name="__TESTING__" value="1" />
<const name="__IS_TEST_ENV__" value="1" />
</php>
</phpunit>
9 changes: 8 additions & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="dev-master@91081f77fdd47a35d12bd87b31291c95f98be8ae">
<files psalm-version="dev-master@6fc9e50b9765d573db796e81522af759bc6987a5">
<file src="examples/TemplateChecker.php">
<PossiblyUndefinedIntArrayOffset>
<code>$comment_block-&gt;tags['variablesfrom'][0]</code>
Expand Down Expand Up @@ -308,6 +308,13 @@
<code>$type &gt; 4</code>
</DocblockTypeContradiction>
</file>
<file src="src/Psalm/Internal/LanguageServer/LanguageServer.php">
<PossiblyUnusedParam>
<code>$capabilities</code>
<code>$processId</code>
<code>$rootPath</code>
</PossiblyUnusedParam>
</file>
<file src="src/Psalm/Internal/LanguageServer/Message.php">
<PossiblyUndefinedIntArrayOffset>
<code>$pair[1]</code>
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ private static function fromXmlAndPaths(
$attribute_text = (string) $config_xml['findUnusedCode'];
$config->find_unused_code = $attribute_text === 'true' || $attribute_text === '1';
$config->find_unused_variables = $config->find_unused_code;
} elseif (!defined('__TESTING__')) {
} elseif (!defined('__IS_TEST_ENV__')) {
fwrite(STDERR, 'Warning: "findUnusedCode" will be defaulted to "true" in Psalm 6. You should explicitly'
. ' enable or disable this setting.' . PHP_EOL);
}
Expand Down
12 changes: 8 additions & 4 deletions src/Psalm/Internal/LanguageServer/LanguageServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,18 @@ function (): void {
/**
* The initialize request is sent as the first request from the client to the server.
*
* @param ClientCapabilities $capabilities The capabilities provided by the client (editor)
* @param string|null $rootPath The rootPath of the workspace. Is null if no folder is open.
* @param int|null $processId The process Id of the parent process that started the server.
* Is null if the process has not been started by another process. If the parent process is
* not alive then the server should exit (see exit notification) its process.
* @psalm-return Promise<InitializeResult>
* @psalm-suppress PossiblyUnusedMethod
* TODO: Remove args in Psalm 6
*/
public function initialize(
ClientCapabilities $_,
?string $__ = null,
?int $___ = null
ClientCapabilities $capabilities,
?string $rootPath = null,
?int $processId = null
): Promise {
return call(
/** @return Generator<int, true, mixed, InitializeResult> */
Expand Down

0 comments on commit cae973e

Please sign in to comment.