【发布时间】:2022-11-15 20:24:22
【问题描述】:
问题是,如果通过 Finder 类观看多个目录。 如果不存在,Finder 将抛出异常,并且修复程序将死亡。
$finder = Finder::create()
->in([
__DIR__ . '/web/app/mu-plugins/ys-*',
__DIR__ . '/web/app/plugins/ys-*'
])
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
是否有可能添加一个选项以“如果目录不存在则跳过”以便如果其中一个目录不存在它不会杀死修复程序?
【问题讨论】:
-
没有这样做的选项,您需要检查(例如使用 array_filter)目录是否存在
标签: symfony phpcs php-cs-fixer symfony-finder