Skip to content

Commit fe2c67e

Browse files
authored
Merge pull request #10699 from staabm/taint-doc
2 parents 395f3f7 + f5fb949 commit fe2c67e

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,13 @@ public static function parse(
238238

239239
if (count($param_parts) >= 2) {
240240
$info->taint_sink_params[] = ['name' => $param_parts[1], 'taint' => $param_parts[0]];
241+
} else {
242+
IssueBuffer::maybeAdd(
243+
new InvalidDocblock(
244+
'@psalm-taint-sink expects 2 arguments',
245+
$code_location,
246+
),
247+
);
241248
}
242249
}
243250
}
@@ -279,6 +286,13 @@ public static function parse(
279286

280287
if ($param_parts[0]) {
281288
$info->taint_source_types[] = $param_parts[0];
289+
} else {
290+
IssueBuffer::maybeAdd(
291+
new InvalidDocblock(
292+
'@psalm-taint-source expects 1 argument',
293+
$code_location,
294+
),
295+
);
282296
}
283297
}
284298
} elseif (isset($parsed_docblock->tags['return-taint'])) {

tests/Template/ConditionalReturnTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ private function getBody() : string {
759759
* @template TSource as self::SOURCE_*
760760
* @param TSource $source
761761
* @return (TSource is "BODY" ? object|list : array)
762-
* @psalm-taint-source
762+
* @psalm-taint-source input
763763
*/
764764
public function getParams(
765765
string $source = self::SOURCE_GET

0 commit comments

Comments
 (0)