-
Notifications
You must be signed in to change notification settings - Fork 650
/
TDependentListKey.php
51 lines (42 loc) · 1008 Bytes
/
TDependentListKey.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
namespace Psalm\Type\Atomic;
use Psalm\Type\Atomic;
/**
* Represents a list key created from foreach ($list as $key => $value)
*/
final class TDependentListKey extends TInt implements DependentType
{
/**
* Used to hold information as to what list variable this refers to
*
* @var string
*/
public $var_id;
/**
* @param string $var_id the variable id
*/
public function __construct(string $var_id)
{
$this->var_id = $var_id;
}
public function getId(bool $exact = true, bool $nested = false): string
{
return 'list-key<' . $this->var_id . '>';
}
public function getVarId(): string
{
return $this->var_id;
}
public function getAssertionString(): string
{
return 'int';
}
public function getReplacement(): Atomic
{
return new TInt();
}
public function canBeFullyExpressedInPhp(int $analysis_php_version_id): bool
{
return false;
}
}