<?php
/** @return string|false */
-function readline(string $prompt = null) {}
+function readline(?string $prompt = null) {}
/** @return mixed */
function readline_info(string $varname = UNKNOWN, string $newvalue = UNKNOWN) {}
/* This is a generated file, edit the .stub.php file instead. */
ZEND_BEGIN_ARG_INFO_EX(arginfo_readline, 0, 0, 0)
- ZEND_ARG_TYPE_INFO(0, prompt, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, prompt, IS_STRING, 1)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_readline_info, 0, 0, 0)
function metaphone(string $text, int $phones = 0) {}
/* {{{ head.c */
-function header(string $string, bool $replace = true, int $http_response_code = null): void { }
+function header(string $string, bool $replace = true, int $http_response_code = 0): void { }
function header_remove(string $name = UNKNOWN): void { }
<?php declare(strict_types=1);
use PhpParser\Node;
+use PhpParser\Node\Expr;
use PhpParser\Node\Stmt;
error_reporting(E_ALL);
$arginfoCode = generateArgInfoCode($funcInfos);
file_put_contents($arginfoFile, $arginfoCode);
} catch (Exception $e) {
- echo "Caught {$e->getMessage()} while processing $stubFile\n";
+ echo "In $stubFile:\n{$e->getMessage()}\n";
exit(1);
}
}
throw new Exception("Error in function $name: only the last parameter can be variadic");
}
+ if ($param->default instanceof Expr\ConstFetch &&
+ $param->default->name->toLowerString() === "null" &&
+ $param->type && !($param->type instanceof Node\NullableType)
+ ) {
+ throw new Exception(
+ "Parameter $varName of function $name has null default, but is not nullable");
+ }
+
$foundVariadic = $param->variadic;
$args[] = new ArgInfo(