diff --git a/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php b/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php index e2a2cc5a14b..7bedbf9e27f 100644 --- a/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php +++ b/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php @@ -238,6 +238,13 @@ public static function parse( if (count($param_parts) >= 2) { $info->taint_sink_params[] = ['name' => $param_parts[1], 'taint' => $param_parts[0]]; + } else { + IssueBuffer::maybeAdd( + new InvalidDocblock( + '@psalm-taint-sink expects 2 arguments', + $code_location, + ), + ); } } } @@ -279,6 +286,13 @@ public static function parse( if ($param_parts[0]) { $info->taint_source_types[] = $param_parts[0]; + } else { + IssueBuffer::maybeAdd( + new InvalidDocblock( + '@psalm-taint-source expects 1 argument', + $code_location, + ), + ); } } } elseif (isset($parsed_docblock->tags['return-taint'])) { diff --git a/tests/Template/ConditionalReturnTypeTest.php b/tests/Template/ConditionalReturnTypeTest.php index 18669470af7..cbdce780a2b 100644 --- a/tests/Template/ConditionalReturnTypeTest.php +++ b/tests/Template/ConditionalReturnTypeTest.php @@ -759,7 +759,7 @@ private function getBody() : string { * @template TSource as self::SOURCE_* * @param TSource $source * @return (TSource is "BODY" ? object|list : array) - * @psalm-taint-source + * @psalm-taint-source input */ public function getParams( string $source = self::SOURCE_GET