You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix validation of CLI arguments when a target manual directory has to be provided
Additionally, let's make sure that we don't try to process the stub files in the
manual target directory. This comes with a slight performance benefit.
if (($replaceClassSynopses || $verifyManual) && $manualTarget === null) {
5151
-
die("A target manual directory must be provided.\n");
5149
+
5150
+
$locations = array_slice($argv, $optind);
5151
+
$locationCount = count($locations);
5152
+
if ($replacePredefinedConstants && $locationCount < 2) {
5153
+
die("At least one source stub path and a target manual directory has to be provided:\n./build/gen_stub.php --replace-predefined-constants ./ ../doc-en/\n");
5152
5154
}
5153
-
if (($replaceMethodSynopses || $verifyManual) && $manualTarget === null) {
5154
-
die("A target manual directory must be provided.\n");
5155
+
if ($replaceClassSynopses&& $locationCount < 2) {
5156
+
die("At least one source stub path and a target manual directory has to be provided:\n./build/gen_stub.php --replace-classsynopses ./ ../doc-en/\n");
5155
5157
}
5156
-
5157
-
if (isset($options["h"]) || isset($options["help"])) {
0 commit comments