diff --git a/build/Makefile.global b/build/Makefile.global index 7b5d2a4919146..237308d265976 100644 --- a/build/Makefile.global +++ b/build/Makefile.global @@ -142,7 +142,7 @@ prof-clean: prof-use: CCACHE_DISABLE=1 $(MAKE) PROF_FLAGS=-fprofile-use all -# olny php above 7.1.0 supports nullable return type +# only php above 7.1.0 supports nullable return type %_arginfo.h: %.stub.php @if test -e "$(top_srcdir)/build/gen_stub.php"; then \ if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \ diff --git a/build/gen_stub.php b/build/gen_stub.php index 02a035debd180..b108191f64447 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -26,21 +26,6 @@ protected function pName_FullyQualified(Name\FullyQualified $node) { } } -if ($argc >= 2) { - if (is_file($argv[1])) { - // Generate single file. - processStubFile($argv[1]); - } else if (is_dir($argv[1])) { - processDirectory($argv[1]); - } else { - echo "$argv[1] is neither a file nor a directory.\n"; - exit(1); - } -} else { - // Regenerate all stub files we can find. - processDirectory('.'); -} - function processDirectory(string $dir) { $it = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($dir), @@ -1044,3 +1029,18 @@ function initPhpParser() { } }); } + +if ($argc >= 2) { + if (is_file($argv[1])) { + // Generate single file. + processStubFile($argv[1]); + } else if (is_dir($argv[1])) { + processDirectory($argv[1]); + } else { + echo "$argv[1] is neither a file nor a directory.\n"; + exit(1); + } +} else { + // Regenerate all stub files we can find. + processDirectory('.'); +}