1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Improve docs

This commit is contained in:
Brown 2020-06-21 01:02:00 -04:00
parent dc83c2e2fc
commit 5e9dc9520e

View File

@ -1,6 +1,21 @@
# Custom Taint Sources
You can define your own taint sources with a plugin.
You can define your own taint sources with an annotation or a plugin.
## Custom taint sourcce annotation
You can use the annotation `@psalm-taint-source <taint-type>` to indicate a function or method that provides user input.
In the below example the `input` taint type is specified as a standin for the four input taints `text`, `html`, `sql` and `shell`.
```php
/**
* @psalm-taint-source input
*/
function getQueryParam(string $name) : string {}
```
## Custom taint plugin
For example this plugin treats all variables named `$bad_data` as taint sources.