mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Added Hook\AfterCodebasePopulatedInterface
This commit is contained in:
parent
8650f9eb1a
commit
24a71be425
@ -306,6 +306,12 @@ class Config
|
||||
*/
|
||||
public $after_visit_classlikes = [];
|
||||
|
||||
/**
|
||||
* Static methods to be called after codebase has been populated
|
||||
* @var class-string<Hook\AfterCodebasePopulatedInterface>[]
|
||||
*/
|
||||
public $after_codebase_populated = [];
|
||||
|
||||
/** @var array<string, mixed> */
|
||||
private $predefined_constants;
|
||||
|
||||
|
@ -392,6 +392,14 @@ class ProjectAnalyzer
|
||||
|
||||
$this->config->visitStubFiles($this->codebase, $this->debug_output);
|
||||
|
||||
$plugin_classes = $this->config->after_codebase_populated;
|
||||
|
||||
if ($plugin_classes) {
|
||||
foreach ($plugin_classes as $plugin_fq_class_name) {
|
||||
$plugin_fq_class_name::afterCodebasePopulated($this->codebase);
|
||||
}
|
||||
}
|
||||
|
||||
$this->codebase->analyzer->analyzeFiles($this, $this->threads, $this->codebase->alter_code);
|
||||
|
||||
if ($this->parser_cache_provider) {
|
||||
|
13
src/Psalm/Plugin/Hook/AfterCodebasePopulatedInterface.php
Normal file
13
src/Psalm/Plugin/Hook/AfterCodebasePopulatedInterface.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace Psalm\Plugin\Hook;
|
||||
|
||||
use Psalm\Codebase;
|
||||
|
||||
interface AfterCodebasePopulatedInterface
|
||||
{
|
||||
/**
|
||||
* Called after codebase has been populated
|
||||
* @return void
|
||||
*/
|
||||
public static function afterCodebasePopulated(Codebase $codebase);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user