-
Notifications
You must be signed in to change notification settings - Fork 571
Expand file tree
/
Copy pathIntertwinedVariableByReferenceWithExpr.php
More file actions
57 lines (46 loc) · 1.08 KB
/
IntertwinedVariableByReferenceWithExpr.php
File metadata and controls
57 lines (46 loc) · 1.08 KB
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
52
53
54
55
56
57
<?php declare(strict_types = 1);
namespace PHPStan\Node\Expr;
use Override;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Variable;
use PHPStan\Node\VirtualNode;
use function is_string;
final class IntertwinedVariableByReferenceWithExpr extends Expr implements VirtualNode
{
public function __construct(private string $variableName, public Expr $expr, private Expr $assignedExpr)
{
parent::__construct([]);
}
public function getVariableName(): string
{
return $this->variableName;
}
public function getExpr(): Expr
{
return $this->expr;
}
public function getAssignedExpr(): Expr
{
return $this->assignedExpr;
}
public function isVariableToVariableReference(): bool
{
return $this->expr instanceof Variable
&& is_string($this->expr->name)
&& $this->assignedExpr instanceof Variable
&& is_string($this->assignedExpr->name);
}
#[Override]
public function getType(): string
{
return 'PHPStan_Node_IntertwinedVariableByReferenceWithExpr';
}
/**
* @return string[]
*/
#[Override]
public function getSubNodeNames(): array
{
return ['expr'];
}
}