in src/builders/FactParseScanner.hack [88:113]
public static function fromTree(string $root): Builder {
$paths = vec[];
$rdi = new \RecursiveDirectoryIterator($root);
$rii = new \RecursiveIteratorIterator($rdi);
foreach ($rii as $info) {
if (!$info->isFile()) {
continue;
}
if (!$info->isReadable()) {
continue;
}
$ext = $info->getExtension();
if (
$ext !== 'php' &&
$ext !== 'hh' &&
$ext !== 'xhp' &&
$ext !== 'hack' &&
$ext !== 'hck'
) {
continue;
}
$paths[] = $info->getPathname();
}
return new FactParseScanner($root, $paths);
}