1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-10 15:09:04 +01:00
psalm/src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallInfo.php

88 lines
1.4 KiB
PHP
Raw Normal View History

<?php
namespace Psalm\Internal\Analyzer\Statements\Expression\Call;
use PhpParser;
2021-12-04 03:37:19 +01:00
use Psalm\Storage\FunctionLikeParameter;
use Psalm\Storage\FunctionLikeStorage;
2021-12-13 16:28:14 +01:00
use Psalm\Type\Union;
/**
* @internal
*/
class FunctionCallInfo
{
/**
* @var ?string
*/
2021-09-26 23:24:07 +02:00
public $function_id;
/**
* @var ?bool
*/
2021-09-26 23:24:07 +02:00
public $function_exists;
/**
* @var bool
*/
public $is_stubbed = false;
/**
* @var bool
*/
public $in_call_map = false;
/**
2021-12-13 16:28:14 +01:00
* @var array<string, Union>
*/
public $defined_constants = [];
/**
* @var array<string, bool>
*/
public $global_variables = [];
/**
2021-12-04 03:37:19 +01:00
* @var ?array<int, FunctionLikeParameter>
*/
2021-09-26 23:24:07 +02:00
public $function_params;
/**
2021-12-04 03:37:19 +01:00
* @var ?FunctionLikeStorage
*/
2021-09-26 23:24:07 +02:00
public $function_storage;
/**
* @var ?PhpParser\Node\Name
*/
2021-09-26 23:24:07 +02:00
public $new_function_name;
/**
* @var bool
*/
public $allow_named_args = true;
/**
* @var array
*/
public $byref_uses = [];
/**
* @mutation-free
*/
public function hasByReferenceParameters(): bool
{
if (null === $this->function_params) {
return false;
}
foreach ($this->function_params as $value) {
if ($value->by_ref) {
return true;
}
}
return false;
}
}