mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Make sure $argv and $argc are not globally available
This commit is contained in:
parent
1001e03f8a
commit
500044dac1
@ -196,6 +196,13 @@ class FileChecker extends SourceChecker implements StatementsSource
|
||||
|
||||
$this->context = new Context();
|
||||
$this->context->count_references = $project_checker->count_references;
|
||||
$this->context->vars_in_scope['$argc'] = Type::getInt();
|
||||
$this->context->vars_in_scope['$argv'] = new Type\Union([
|
||||
new Type\Atomic\TArray([
|
||||
Type::getInt(),
|
||||
Type::getString(),
|
||||
])
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -490,17 +490,15 @@ class ExpressionChecker
|
||||
if (in_array(
|
||||
$stmt->name,
|
||||
[
|
||||
'GLOBALS',
|
||||
'_SERVER',
|
||||
'_GET',
|
||||
'_POST',
|
||||
'_COOKIE',
|
||||
'_REQUEST',
|
||||
'_FILES',
|
||||
'_ENV',
|
||||
'_COOKIE',
|
||||
'_SESSION',
|
||||
'GLOBALS',
|
||||
'argv',
|
||||
'argc',
|
||||
'_REQUEST',
|
||||
'_ENV',
|
||||
]
|
||||
)
|
||||
) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user