本文整理匯總了PHP中Phan\CodeBase::dependencyListForFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP CodeBase::dependencyListForFile方法的具體用法?PHP CodeBase::dependencyListForFile怎麽用?PHP CodeBase::dependencyListForFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Phan\CodeBase
的用法示例。
在下文中一共展示了CodeBase::dependencyListForFile方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: expandedFileList
/**
* @param CodeBase $code_base
* A code base needs to be passed in because we require
* it to be initialized before any classes or files are
* loaded.
*
* @param string[] $file_path_list
* A set of files to expand with the set of dependencies
* on those files.
*
* @return string[]
* Get an expanded list of files and dependencies for
* the given file list
*/
public static function expandedFileList(CodeBase $code_base, array $file_path_list) : array
{
$file_count = count($file_path_list);
// We'll construct a set of files that we'll
// want to run an analysis on
$dependency_file_path_list = [];
foreach ($file_path_list as $i => $file_path) {
CLI::progress('dependencies', ($i + 1) / $file_count);
// Add the file itself to the list
$dependency_file_path_list[] = $file_path;
// Add any files that depend on this file
$dependency_file_path_list = array_merge($dependency_file_path_list, $code_base->dependencyListForFile($file_path));
}
return array_unique($dependency_file_path_list);
}