Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions build/gen_stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -2311,18 +2311,20 @@ function initPhpParser() {
}

$fileInfos = [];
$location = $argv[$optind] ?? ".";
if (is_file($location)) {
// Generate single file.
$fileInfo = processStubFile($location, $context);
if ($fileInfo) {
$fileInfos[] = $fileInfo;
}
} else if (is_dir($location)) {
$fileInfos = processDirectory($location, $context);
} else {
echo "$location is neither a file nor a directory.\n";
exit(1);
$locations = array_slice($argv, $optind) ?: ['.'];
foreach (array_unique($locations) as $location) {
if (is_file($location)) {
// Generate single file.
$fileInfo = processStubFile($location, $context);
if ($fileInfo) {
$fileInfos[] = $fileInfo;
}
} else if (is_dir($location)) {
array_push($fileInfos, ...processDirectory($location, $context));
} else {
echo "$location is neither a file nor a directory.\n";
exit(1);
}
}

if ($printParameterStats) {
Expand Down