mirror of
https://github.com/danog/psalm.git
synced 2024-12-02 09:37:59 +01:00
Only create after analysis event if they exist
Fixes #5008 - this does some git execing, so we don’t want it to always run
This commit is contained in:
parent
8954c12eaa
commit
2fbfc429b7
@ -544,6 +544,9 @@ class IssueBuffer
|
|||||||
$source_control_info = null;
|
$source_control_info = null;
|
||||||
$build_info = (new \Psalm\Internal\ExecutionEnvironment\BuildInfoCollector($_SERVER))->collect();
|
$build_info = (new \Psalm\Internal\ExecutionEnvironment\BuildInfoCollector($_SERVER))->collect();
|
||||||
|
|
||||||
|
if ($codebase->config->eventDispatcher->after_analysis
|
||||||
|
|| $codebase->config->eventDispatcher->legacy_after_analysis
|
||||||
|
) {
|
||||||
try {
|
try {
|
||||||
$source_control_info = (new \Psalm\Internal\ExecutionEnvironment\GitInfoCollector())->collect();
|
$source_control_info = (new \Psalm\Internal\ExecutionEnvironment\GitInfoCollector())->collect();
|
||||||
} catch (\RuntimeException $e) {
|
} catch (\RuntimeException $e) {
|
||||||
@ -559,6 +562,7 @@ class IssueBuffer
|
|||||||
);
|
);
|
||||||
|
|
||||||
$codebase->config->eventDispatcher->dispatchAfterAnalysis($event);
|
$codebase->config->eventDispatcher->dispatchAfterAnalysis($event);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($project_analyzer->generated_report_options as $report_options) {
|
foreach ($project_analyzer->generated_report_options as $report_options) {
|
||||||
if (!$report_options->output_path) {
|
if (!$report_options->output_path) {
|
||||||
|
Loading…
Reference in New Issue
Block a user