1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Add some more flows (#4659)

* Add some more flows

- Adds all relevant JSON flows https://www.php.net/manual/en/ref.json.php
- Adds all relevant misc flows https://www.php.net/manual/en/ref.misc.php
- Adds a small subset of URL flows https://www.php.net/manual/en/ref.url.php

* Update CoreGenericFunctions.phpstub
This commit is contained in:
Lukas Reschke 2020-11-22 18:09:55 +01:00 committed by Daniil Gentili
parent 684340cbe3
commit 31c63a6c96
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -362,11 +362,28 @@ function print_r($var, bool $return = false) {}
/**
* @psalm-pure
*
* @psalm-taint-sink file $var
* @param mixed $var
* @return ($return is true ? string : bool)
*/
function highlight_file($var, bool $return = false) {}
/**
* @psalm-pure
*
* @psalm-taint-sink file $var
* @param mixed $var
* @return ($return is true ? string : bool)
*/
function show_source($var, bool $return = false) {}
/**
* @psalm-pure
*
* @psalm-taint-sink file $filename
*/
function php_strip_whitespace(string $filename) : string {}
/**
* @psalm-pure
*
@ -1091,3 +1108,89 @@ function convert_uuencode(string $data) : string
* @psalm-flow ($value) -> return
*/
function ldap_escape(string $value, string $ignore = "", int $flag = 0) : string {}
/**
* @psalm-pure
*
* @return mixed
* @psalm-flow ($json) -> return
*/
function json_decode(string $json, ?bool $associative = null, int $depth = 512, int $flags = 0) {}
/**
* @psalm-pure
*
* @return string|false
*
* @psalm-flow ($value) -> return
* @psalm-ignore-falsable-return
*/
function json_encode(mixed $value, int $flags = 0, int $depth = 512) {}
/**
* @psalm-pure
*
* @return string|false
*
* @psalm-flow ($values) -> return
* @psalm-ignore-falsable-return
*/
function pack(string $format, mixed ...$values) {}
/**
* @psalm-pure
*
* @param string|int $in_codepage
* @param string|int $out_codepage
* @psalm-flow ($subject) -> return
*/
function sapi_windows_cp_conv($in_codepage, $out_codepage, string $subject) : string {}
/**
* @psalm-pure
*
* @psalm-flow ($prefix) -> return
*/
function uniqid(string $prefix = "", bool $more_entropy = false) : string {}
/**
* @psalm-pure
*
* @return array
*
* @psalm-flow ($data) -> return
*/
function unpack(string $format, string $data, int $offset = 0) {}
/**
* @psalm-pure
*
* @return string|false
*
* @psalm-flow ($data) -> return
* @psalm-ignore-falsable-return
*/
function base64_decode(string $data, bool $strict = false) {}
/**
* @psalm-pure
*
* @psalm-flow ($data) -> return
*/
function base64_encode(string $data) : string {}
/**
* @psalm-pure
*
* @param resource $context
*
* @psalm-taint-sink ssrf $url
*/
function get_headers(string $url, int $format = 0, $context) : array {}
/**
* @psalm-pure
*
* @psalm-taint-sink ssrf $filename
*/
function get_meta_tags(string $filename, bool $use_include_path = false) : array {}