Skip to content

Commit

Permalink
fix: pass var docblock comments by ref
Browse files Browse the repository at this point in the history
After extracting into seperate method, var_comments weren't overriden.
  • Loading branch information
Patrick-Remy committed Feb 9, 2025
1 parent 9c48910 commit 71d9de1
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public static function analyze(
$var_id,
$assign_value_type,
$doc_comment,
$var_comments,
$comment_type,
$comment_type_location,
$not_ignored_docblock_var_ids,
Expand Down Expand Up @@ -596,6 +597,7 @@ private static function analyzeAssignment(
}

/**
* @return list<VarDocblockComment> $var_comment

Check failure on line 600 in src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php

View workflow job for this annotation

GitHub Actions / build

MismatchingDocblockReturnType

src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:600:16: MismatchingDocblockReturnType: Docblock has incorrect return type 'list<Psalm\Internal\Scanner\VarDocblockComment>', should be 'void' (see https://psalm.dev/142)

Check failure on line 600 in src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php

View workflow job for this annotation

GitHub Actions / build

InvalidReturnType

src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:600:16: InvalidReturnType: The declared return type 'list<Psalm\Internal\Scanner\VarDocblockComment>' for Psalm\Internal\Analyzer\Statements\Expression\AssignmentAnalyzer::analyzeDocComment is incorrect, got 'void' (see https://psalm.dev/011)

Check failure on line 600 in src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php

View workflow job for this annotation

GitHub Actions / build

UnusedReturnValue

src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:600:16: UnusedReturnValue: The return value for this private method is never used (see https://psalm.dev/272)

Check failure on line 600 in src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php

View workflow job for this annotation

GitHub Actions / build

MismatchingDocblockReturnType

src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:600:16: MismatchingDocblockReturnType: Docblock has incorrect return type 'list<Psalm\Internal\Scanner\VarDocblockComment>', should be 'void' (see https://psalm.dev/142)

Check failure on line 600 in src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php

View workflow job for this annotation

GitHub Actions / build

InvalidReturnType

src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:600:16: InvalidReturnType: The declared return type 'list<Psalm\Internal\Scanner\VarDocblockComment>' for Psalm\Internal\Analyzer\Statements\Expression\AssignmentAnalyzer::analyzeDocComment is incorrect, got 'void' (see https://psalm.dev/011)

Check failure on line 600 in src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php

View workflow job for this annotation

GitHub Actions / build

UnusedReturnValue

src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:600:16: UnusedReturnValue: The return value for this private method is never used (see https://psalm.dev/272)
* @param list<string> $removed_taints
*/
private static function analyzeDocComment(
Expand All @@ -606,6 +608,7 @@ private static function analyzeDocComment(
?string $var_id,
?Union $assign_value_type,
?Doc $doc_comment,
array &$var_comments,
?Union &$comment_type,
?DocblockTypeLocation &$comment_type_location,
array $not_ignored_docblock_var_ids,
Expand Down

0 comments on commit 71d9de1

Please sign in to comment.