diff --git a/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php b/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php index e2a2cc5a1..923313ec3 100644 --- a/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php +++ b/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php @@ -238,6 +238,8 @@ final class FunctionLikeDocblockParser if (count($param_parts) >= 2) { $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]) { $info->taint_source_types[] = $param_parts[0]; + } else { + throw new IncorrectDocblockException('@psalm-taint-source expects 1 argument'); } } } elseif (isset($parsed_docblock->tags['return-taint'])) {