mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 12:55:26 +01:00
If extending FileChecker, inline included stmts
This commit is contained in:
parent
87871e61f2
commit
77c9d1ecbd
@ -609,14 +609,20 @@ class StatementsChecker extends SourceChecker implements StatementsSource
|
||||
|
||||
if ($this->getFileChecker()->fileExists($path_to_file)) {
|
||||
$include_stmts = FileChecker::getStatementsForFile($path_to_file);
|
||||
$include_file_checker = new FileChecker(
|
||||
$path_to_file,
|
||||
$current_file_checker->project_checker,
|
||||
$include_stmts
|
||||
);
|
||||
$include_file_checker->setFileName($this->getFileName(), $this->getFilePath());
|
||||
$include_file_checker->visit($context);
|
||||
$include_file_checker->analyze();
|
||||
|
||||
if (is_subclass_of($current_file_checker, 'Psalm\\Checker\\FileChecker')) {
|
||||
$this->analyze($include_stmts, $context);
|
||||
} else {
|
||||
$include_file_checker = new FileChecker(
|
||||
$path_to_file,
|
||||
$current_file_checker->project_checker,
|
||||
$include_stmts
|
||||
);
|
||||
$include_file_checker->setFileName($this->getFileName(), $this->getFilePath());
|
||||
$include_file_checker->visit($context);
|
||||
$include_file_checker->analyze();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user