Skip to content

Commit

Permalink
Report invalid number of arguments for psalm-taint-*
Browse files Browse the repository at this point in the history
  • Loading branch information
clxmstaab authored and staabm committed Feb 12, 2024
1 parent 395f3f7 commit da69803
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ public static function parse(

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');
}
}
}
Expand Down Expand Up @@ -279,6 +281,8 @@ public static function parse(

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'])) {
Expand Down

0 comments on commit da69803

Please sign in to comment.