From: Côme Chilliet Date: Mon, 21 Sep 2020 12:50:15 +0000 (+0200) Subject: Explicitely mark nullable strings X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa1f86f11c1f32a8869f29531961575788c3cc53;p=php Explicitely mark nullable strings --- diff --git a/ext/ldap/ldap.stub.php b/ext/ldap/ldap.stub.php index 6cc89b6137..1c534284fd 100644 --- a/ext/ldap/ldap.stub.php +++ b/ext/ldap/ldap.stub.php @@ -4,10 +4,10 @@ #ifdef HAVE_ORALDAP /** @return resource|false */ -function ldap_connect(string $uri = null, int $port = 389, string $wallet = UNKNOWN, string $wallet_passwd = UNKNOWN, int $authmode = GSLC_SSL_NO_AUTH) {} +function ldap_connect(?string $uri = null, int $port = 389, string $wallet = UNKNOWN, string $wallet_passwd = UNKNOWN, int $authmode = GSLC_SSL_NO_AUTH) {} #else /** @return resource|false */ -function ldap_connect(string $uri = null, int $port = 389) {} +function ldap_connect(?string $uri = null, int $port = 389) {} #endif /** @param resource $link */ @@ -20,17 +20,17 @@ function ldap_unbind($link): bool {} function ldap_close($link): bool {} /** @param resource $link */ -function ldap_bind($link, string $dn = null, string $password = null): bool {} +function ldap_bind($link, ?string $dn = null, ?string $password = null): bool {} /** * @param resource $link * @return resource|false */ -function ldap_bind_ext($link, string $dn = null, string $password = null, array $controls = []) {} +function ldap_bind_ext($link, ?string $dn = null, ?string $password = null, array $controls = []) {} #ifdef HAVE_LDAP_SASL /** @param resource $link */ -function ldap_sasl_bind($link, string $dn = null, string $password = null, string $mech = null, string $realm = null, string $authc_id = null, string $authz_id = null, string $props = null): bool {} +function ldap_sasl_bind($link, ?string $dn = null, ?string $password = null, ?string $mech = null, ?string $realm = null, ?string $authc_id = null, ?string $authz_id = null, ?string $props = null): bool {} #endif /** diff --git a/ext/ldap/ldap_arginfo.h b/ext/ldap/ldap_arginfo.h index 922e66997c..25f8227911 100644 --- a/ext/ldap/ldap_arginfo.h +++ b/ext/ldap/ldap_arginfo.h @@ -1,9 +1,9 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: daec139fe03acf248017060876e80bf7cab89e3a */ + * Stub hash: 739893b4bf6f34da80b7c7b10a670c16d4239bdb */ #if defined(HAVE_ORALDAP) ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, uri, IS_STRING, 0, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, uri, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 0, "389") ZEND_ARG_TYPE_INFO(0, wallet, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, wallet_passwd, IS_STRING, 0) @@ -13,7 +13,7 @@ ZEND_END_ARG_INFO() #if !(defined(HAVE_ORALDAP)) ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, uri, IS_STRING, 0, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, uri, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 0, "389") ZEND_END_ARG_INFO() #endif @@ -26,27 +26,27 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_bind, 0, 1, _IS_BOOL, 0) ZEND_ARG_INFO(0, link) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dn, IS_STRING, 0, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 0, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dn, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_bind_ext, 0, 0, 1) ZEND_ARG_INFO(0, link) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dn, IS_STRING, 0, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 0, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dn, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, controls, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() #if defined(HAVE_LDAP_SASL) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_sasl_bind, 0, 1, _IS_BOOL, 0) ZEND_ARG_INFO(0, link) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dn, IS_STRING, 0, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 0, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mech, IS_STRING, 0, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, realm, IS_STRING, 0, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, authc_id, IS_STRING, 0, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, authz_id, IS_STRING, 0, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, props, IS_STRING, 0, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dn, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mech, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, realm, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, authc_id, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, authz_id, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, props, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #endif