mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Merge pull request #10093 from kkmuffme/inconsistent-argv-argc-in-context
argv and argc were inconsistent in Context with VariableFetchAnalyzer
This commit is contained in:
commit
a6e2e31aae
@ -12,7 +12,8 @@ use Psalm\Internal\Scope\LoopScope;
|
||||
use Psalm\Internal\Type\AssertionReconciler;
|
||||
use Psalm\Storage\FunctionLikeStorage;
|
||||
use Psalm\Type\Atomic\DependentType;
|
||||
use Psalm\Type\Atomic\TArray;
|
||||
use Psalm\Type\Atomic\TIntRange;
|
||||
use Psalm\Type\Atomic\TNull;
|
||||
use Psalm\Type\Union;
|
||||
use RuntimeException;
|
||||
|
||||
@ -868,10 +869,19 @@ final class Context
|
||||
public function defineGlobals(): void
|
||||
{
|
||||
$globals = [
|
||||
// not sure why this is declared here again, see VariableFetchAnalyzer
|
||||
'$argv' => new Union([
|
||||
new TArray([Type::getInt(), Type::getString()]),
|
||||
Type::getNonEmptyListAtomic(Type::getString()),
|
||||
new TNull(),
|
||||
], [
|
||||
'ignore_nullable_issues' => true,
|
||||
]),
|
||||
'$argc' => new Union([
|
||||
new TIntRange(1, null),
|
||||
new TNull(),
|
||||
], [
|
||||
'ignore_nullable_issues' => true,
|
||||
]),
|
||||
'$argc' => Type::getInt(),
|
||||
];
|
||||
|
||||
$config = Config::getInstance();
|
||||
|
Loading…
x
Reference in New Issue
Block a user