Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Dec 3, 2023
1 parent 0aeb87c commit de53638
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 8 deletions.
37 changes: 35 additions & 2 deletions 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="5.x-dev@9bc98ecd47a4b83a663783c5a4744d48605d3eba">
<files psalm-version="5.x-dev@5acde045f126440ded206b406cf37b649ede84fc">
<file src="examples/TemplateChecker.php">
<PossiblyUndefinedIntArrayOffset>
<code><![CDATA[$comment_block->tags['variablesfrom'][0]]]></code>
Expand Down Expand Up @@ -216,20 +216,27 @@
</PossiblyUndefinedIntArrayOffset>
</file>
<file src="src/Psalm/Internal/Analyzer/Statements/UnusedAssignmentRemover.php">
<PossiblyUndefinedArrayOffset>
<code>$token_list[$iter]</code>
</PossiblyUndefinedArrayOffset>
<PossiblyUndefinedIntArrayOffset>
<code>$token_list[$iter]</code>
<code>$token_list[$iter]</code>
<code>$token_list[$iter]</code>
<code>$token_list[$iter]</code>
<code>$token_list[0]</code>
<code>$token_list[1]</code>
</PossiblyUndefinedIntArrayOffset>
</file>
<file src="src/Psalm/Internal/Analyzer/StatementsAnalyzer.php">
<PossiblyUndefinedArrayOffset>
<code><![CDATA[$stmt->expr->getArgs()[0]]]></code>
</PossiblyUndefinedArrayOffset>
</file>
<file src="src/Psalm/Internal/Cli/Psalm.php">
<PossiblyInvalidArgument>
<code><![CDATA[$options['f'] ?? null]]></code>
</PossiblyInvalidArgument>
</file>
<file src="src/Psalm/Internal/Cli/Refactor.php">
<PossiblyUndefinedIntArrayOffset>
<code>$identifier_name</code>
Expand Down Expand Up @@ -350,6 +357,32 @@
<code>$cs[0]</code>
</PossiblyUndefinedIntArrayOffset>
</file>
<file src="src/Psalm/Internal/PluginManager/Command/DisableCommand.php">
<RedundantCondition>
<code>$config_file_path !== null</code>
</RedundantCondition>
<ReservedWord>
<code><![CDATA[$input->getArgument('pluginName')]]></code>
<code><![CDATA[$input->getOption('config')]]></code>
</ReservedWord>
</file>
<file src="src/Psalm/Internal/PluginManager/Command/EnableCommand.php">
<RedundantCondition>
<code>$config_file_path !== null</code>
</RedundantCondition>
<ReservedWord>
<code><![CDATA[$input->getArgument('pluginName')]]></code>
<code><![CDATA[$input->getOption('config')]]></code>
</ReservedWord>
</file>
<file src="src/Psalm/Internal/PluginManager/Command/ShowCommand.php">
<RedundantCondition>
<code>$config_file_path !== null</code>
</RedundantCondition>
<ReservedWord>
<code><![CDATA[$input->getOption('config')]]></code>
</ReservedWord>
</file>
<file src="src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayMapReturnTypeProvider.php">
<PossiblyUndefinedIntArrayOffset>
<code>$callable_method_name</code>
Expand Down
2 changes: 1 addition & 1 deletion psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
limitMethodComplexity="true"
errorBaseline="psalm-baseline.xml"
findUnusedPsalmSuppress="true"
findUnusedBaselineEntry="true"
findUnusedBaselineEntry="false"
>
<stubs>
<file name="stubs/phpparser.phpstub"/>
Expand Down
8 changes: 3 additions & 5 deletions src/Psalm/Internal/Cli/LanguageServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,9 @@ static function (string $arg) use ($valid_long_options): void {

$path_to_config = CliUtils::getPathToConfig($options);

if (isset($options['tcp'])) {
if (!is_string($options['tcp'])) {
fwrite(STDERR, 'tcp url should be a string' . PHP_EOL);
exit(1);
}
if (isset($options['tcp']) && !is_string($options['tcp'])) {
fwrite(STDERR, 'tcp url should be a string' . PHP_EOL);
exit(1);
}

$config = CliUtils::initializeConfig(
Expand Down

0 comments on commit de53638

Please sign in to comment.