forked from vimeo/psalm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BeforeStatementAnalysisEvent.php
83 lines (71 loc) · 1.79 KB
/
BeforeStatementAnalysisEvent.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
declare(strict_types=1);
namespace Psalm\Plugin\EventHandler\Event;
use PhpParser\Node\Stmt;
use Psalm\Codebase;
use Psalm\Context;
use Psalm\FileManipulation;
use Psalm\StatementsSource;
final class BeforeStatementAnalysisEvent
{
private Stmt $stmt;
private Context $context;
private StatementsSource $statements_source;
private Codebase $codebase;
/**
* @var list<FileManipulation>
*/
private array $file_replacements;
/**
* Called after a statement has been checked
*
* @param list<FileManipulation> $file_replacements
*/
public function __construct(
Stmt $stmt,
Context $context,
StatementsSource $statements_source,
Codebase $codebase,
array $file_replacements = []
) {
$this->stmt = $stmt;
$this->context = $context;
$this->statements_source = $statements_source;
$this->codebase = $codebase;
$this->file_replacements = $file_replacements;
}
public function getStmt(): Stmt
{
return $this->stmt;
}
public function setStmt(Stmt $stmt): void
{
$this->stmt = $stmt;
}
public function getContext(): Context
{
return $this->context;
}
public function getStatementsSource(): StatementsSource
{
return $this->statements_source;
}
public function getCodebase(): Codebase
{
return $this->codebase;
}
/**
* @return list<FileManipulation>
*/
public function getFileReplacements(): array
{
return $this->file_replacements;
}
/**
* @param list<FileManipulation> $file_replacements
*/
public function setFileReplacements(array $file_replacements): void
{
$this->file_replacements = $file_replacements;
}
}