Skip to content

Commit

Permalink
Merge pull request #10699 from staabm/taint-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan authored Feb 13, 2024
2 parents 395f3f7 + f5fb949 commit fe2c67e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
);
}
}
}
Expand Down Expand Up @@ -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'])) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Template/ConditionalReturnTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fe2c67e

Please sign in to comment.