Skip to content

Tag reference

@psalm-assert-untainted

The @psalm-assert-untainted tag asserts that the given variable holds no tainted data from this point on. It is part of Psalm’s taint-analysis assertion family, alongside @psalm-assert.

Grammar

"@psalm-assert-untainted" <Variable> [ <Description> ]

Examples

Asserting that a value is safe after sanitization.
/**
* @psalm-assert-untainted $input
*/
function sanitize(string $input): string {}

Names by platform

psalm
@psalm-assert-untainted

Parsing a @psalm-assert-untainted tag produces a PsalmAssertUntaintedTag instance, carrying the asserted $variable alongside the $name and optional $description every Tag already provides.

final class PsalmAssertUntaintedTag extends VariableTag {}

See Psalm’s security analysis annotations.