mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Add stub for json_encode
This commit is contained in:
parent
4aae4fc631
commit
4b36c4e4bf
@ -2011,9 +2011,9 @@ class Config
|
|||||||
}
|
}
|
||||||
$php_version = $composer_json['require']['php'] ?? null;
|
$php_version = $composer_json['require']['php'] ?? null;
|
||||||
|
|
||||||
if ($php_version) {
|
if (\is_string($php_version)) {
|
||||||
foreach (['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] as $candidate) {
|
foreach (['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] as $candidate) {
|
||||||
if (Semver::satisfies($candidate, (string)$php_version)) {
|
if (Semver::satisfies($candidate, $php_version)) {
|
||||||
return $candidate;
|
return $candidate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -328,6 +328,20 @@ function sodium_memzero(string &$reference): void
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @psalm-return (
|
||||||
|
* $associative is true
|
||||||
|
* ? null|scalar|array<null|scalar|array<null|scalar|array>>
|
||||||
|
* : null|scalar|array<int, null|scalar|array<int, null|scalar|array|stdClass>|stdClass>|stdClass
|
||||||
|
* )
|
||||||
|
*/
|
||||||
|
function json_decode(
|
||||||
|
string $json,
|
||||||
|
bool $associative = false,
|
||||||
|
int $depth = 512,
|
||||||
|
int $options = 0
|
||||||
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string|string[] $search
|
* @param string|string[] $search
|
||||||
* @param string|string[] $replace
|
* @param string|string[] $replace
|
||||||
|
@ -132,8 +132,10 @@ function getVendorDir($current_dir)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($composer_json['config']['vendor-dir'])) {
|
if (isset($composer_json['config']['vendor-dir'])
|
||||||
return (string) $composer_json['config']['vendor-dir'];
|
&& is_string($composer_json['config']['vendor-dir'])
|
||||||
|
) {
|
||||||
|
return $composer_json['config']['vendor-dir'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'vendor';
|
return 'vendor';
|
||||||
|
Loading…
Reference in New Issue
Block a user