Skip to content

Tag reference

@psalm-taint-sink

The @psalm-taint-sink tag marks an argument as a taint sink for the given taint type. It is part of Psalm’s taint-analysis annotations.

Grammar

"@psalm-taint-sink" <Name> <Variable>

Examples

An argument that must not receive tainted SQL.
/**
* @psalm-taint-sink sql $query
*/
public function execute(string $query): void

Names by platform

psalm
@psalm-taint-sink

Parsing a @psalm-taint-sink tag produces a PsalmTaintSinkTag instance, carrying the parsed $taint type and $variable alongside the $name every Tag already provides.

final class PsalmTaintSinkTag extends Tag {}

See Psalm’s security analysis annotations.