mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
adds statements list in the event (#4835)
This commit is contained in:
parent
7f4550a889
commit
e99cf5f514
@ -271,7 +271,7 @@ class FileAnalyzer extends SourceAnalyzer
|
||||
}
|
||||
}
|
||||
|
||||
$event = new AfterFileAnalysisEvent($this, $this->context, $file_storage, $codebase);
|
||||
$event = new AfterFileAnalysisEvent($this, $this->context, $file_storage, $codebase, $stmts);
|
||||
$codebase->config->eventDispatcher->dispatchAfterFileAnalysis($event);
|
||||
|
||||
$this->class_analyzers_to_analyze = [];
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
namespace Psalm\Plugin\EventHandler\Event;
|
||||
|
||||
use PhpParser\Node\Stmt;
|
||||
use Psalm\Codebase;
|
||||
use Psalm\Context;
|
||||
use Psalm\StatementsSource;
|
||||
@ -26,20 +27,28 @@ class AfterFileAnalysisEvent
|
||||
* @var Codebase
|
||||
*/
|
||||
private $codebase;
|
||||
/**
|
||||
* @var Stmt[]
|
||||
*/
|
||||
private $stmts;
|
||||
|
||||
/**
|
||||
* Called after a file has been checked
|
||||
*
|
||||
* @param array<Stmt> $stmts
|
||||
*/
|
||||
public function __construct(
|
||||
StatementsSource $statements_source,
|
||||
Context $file_context,
|
||||
FileStorage $file_storage,
|
||||
Codebase $codebase
|
||||
Codebase $codebase,
|
||||
array $stmts
|
||||
) {
|
||||
$this->statements_source = $statements_source;
|
||||
$this->file_context = $file_context;
|
||||
$this->file_storage = $file_storage;
|
||||
$this->codebase = $codebase;
|
||||
$this->stmts = $stmts;
|
||||
}
|
||||
|
||||
public function getStatementsSource(): StatementsSource
|
||||
@ -61,4 +70,12 @@ class AfterFileAnalysisEvent
|
||||
{
|
||||
return $this->codebase;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Stmt[]
|
||||
*/
|
||||
public function getStmts(): array
|
||||
{
|
||||
return $this->stmts;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user