\Framework\EventListenerScanner

Summary

Methods
Properties
Constants
__construct()
getSubscribers()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
scanAndBuild()
getClassFromFile()
generateFingerprint()
$listenerDir
$cache
$cacheTtl
$cacheKey
N/A

Properties

$listenerDir

$listenerDir : string

Type

string

$cache

$cache : \Framework\Cache\CacheFactory

Type

CacheFactory

$cacheTtl

$cacheTtl : int

Type

int

$cacheKey

$cacheKey : string

Type

string

Methods

__construct()

__construct(\Framework\Cache\CacheFactory  $cache, ?string  $listenerDir = null) : mixed

Parameters

\Framework\Cache\CacheFactory $cache
?string $listenerDir

Returns

mixed —

getSubscribers()

getSubscribers() : array

获取监听器(自动缓存 + 自动刷新).

Returns

array —

scanAndBuild()

scanAndBuild() : array

核心扫描逻辑:支持 Interface 和 Attributes

Returns

array —

getClassFromFile()

getClassFromFile(string  $path) : ?string

辅助方法:简单的从文件路径推断类名 (根据你的项目结构调整)

Parameters

string $path

Returns

?string —

generateFingerprint()

generateFingerprint() : string

生成监听器目录的指纹(基于文件修改时间).

Returns

string —