1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Report invalid number of arguments for psalm-taint-*

This commit is contained in:
Markus Staab 2024-02-12 10:45:05 +01:00 committed by Markus Staab
parent 395f3f7862
commit da69803823

View File

@ -238,6 +238,8 @@ final class FunctionLikeDocblockParser
if (count($param_parts) >= 2) { if (count($param_parts) >= 2) {
$info->taint_sink_params[] = ['name' => $param_parts[1], 'taint' => $param_parts[0]]; $info->taint_sink_params[] = ['name' => $param_parts[1], 'taint' => $param_parts[0]];
} else {
throw new IncorrectDocblockException('@psalm-taint-sink expects 2 arguments');
} }
} }
} }
@ -279,6 +281,8 @@ final class FunctionLikeDocblockParser
if ($param_parts[0]) { if ($param_parts[0]) {
$info->taint_source_types[] = $param_parts[0]; $info->taint_source_types[] = $param_parts[0];
} else {
throw new IncorrectDocblockException('@psalm-taint-source expects 1 argument');
} }
} }
} elseif (isset($parsed_docblock->tags['return-taint'])) { } elseif (isset($parsed_docblock->tags['return-taint'])) {