Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHP 8.4] Fixes for implicit nullability deprecation #441

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions deprecated/datetime.php
Expand Up @@ -21,7 +21,7 @@
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
*
*/
function gmdate(string $format, int $timestamp = null): string
function gmdate(string $format, ?int $timestamp = null): string
{
error_clear_last();
if ($timestamp !== null) {
Expand Down Expand Up @@ -75,7 +75,7 @@ function gmdate(string $format, int $timestamp = null): string
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
*
*/
function mktime(int $hour, int $minute = null, int $second = null, int $month = null, int $day = null, int $year = null): int
function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null): int
{
error_clear_last();
if ($year !== null) {
Expand Down
4 changes: 2 additions & 2 deletions deprecated/mssql.php
Expand Up @@ -97,7 +97,7 @@ function mssql_close($link_identifier = null): void
* @throws MssqlException
*
*/
function mssql_connect(string $servername = null, string $username = null, string $password = null, bool $new_link = false)
function mssql_connect(?string $servername = null, ?string $username = null, ?string $password = null, bool $new_link = false)
{
error_clear_last();
if ($new_link !== false) {
Expand Down Expand Up @@ -330,7 +330,7 @@ function mssql_init(string $sp_name, $link_identifier = null)
* @throws MssqlException
*
*/
function mssql_pconnect(string $servername = null, string $username = null, string $password = null, bool $new_link = false)
function mssql_pconnect(?string $servername = null, ?string $username = null, ?string $password = null, bool $new_link = false)
{
error_clear_last();
if ($new_link !== false) {
Expand Down
2 changes: 1 addition & 1 deletion deprecated/password.php
Expand Up @@ -112,7 +112,7 @@
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
*
*/
function password_hash(string $password, $algo, array $options = null): string
function password_hash(string $password, $algo, ?array $options = null): string
{
error_clear_last();
if ($options !== null) {
Expand Down
2 changes: 1 addition & 1 deletion deprecated/strings.php
Expand Up @@ -361,7 +361,7 @@ function sprintf(string $format, ...$params): string
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
*
*/
function substr(string $string, int $start, int $length = null): string
function substr(string $string, int $start, ?int $length = null): string
{
error_clear_last();
if ($length !== null) {
Expand Down
2 changes: 1 addition & 1 deletion generated/bzip2.php
Expand Up @@ -82,7 +82,7 @@ function bzread($bz, int $length = 1024): string
* @throws Bzip2Exception
*
*/
function bzwrite($bz, string $data, int $length = null): int
function bzwrite($bz, string $data, ?int $length = null): int
{
error_clear_last();
if ($length !== null) {
Expand Down
2 changes: 1 addition & 1 deletion generated/calendar.php
Expand Up @@ -15,7 +15,7 @@
* @throws CalendarException
*
*/
function unixtojd(int $timestamp = null): int
function unixtojd(?int $timestamp = null): int
{
error_clear_last();
if ($timestamp !== null) {
Expand Down
2 changes: 1 addition & 1 deletion generated/com.php
Expand Up @@ -138,7 +138,7 @@ function com_load_typelib(string $typelib, bool $case_insensitive = true): void
* @throws ComException
*
*/
function com_print_typeinfo(object $variant, string $dispatch_interface = null, bool $display_sink = false): void
function com_print_typeinfo(object $variant, ?string $dispatch_interface = null, bool $display_sink = false): void
{
error_clear_last();
if ($display_sink !== false) {
Expand Down
16 changes: 8 additions & 8 deletions generated/cubrid.php
Expand Up @@ -124,7 +124,7 @@
* @throws CubridException
*
*/
function cubrid_bind($req_identifier, int $bind_index, $bind_value, string $bind_value_type = null): void
function cubrid_bind($req_identifier, int $bind_index, $bind_value, ?string $bind_value_type = null): void
{
error_clear_last();
if ($bind_value_type !== null) {
Expand Down Expand Up @@ -303,7 +303,7 @@ function cubrid_commit($conn_identifier): void
* @throws CubridException
*
*/
function cubrid_connect_with_url(string $conn_url, string $userid = null, string $passwd = null, bool $new_link = false)
function cubrid_connect_with_url(string $conn_url, ?string $userid = null, ?string $passwd = null, bool $new_link = false)
{
error_clear_last();
if ($new_link !== false) {
Expand Down Expand Up @@ -347,7 +347,7 @@ function cubrid_connect_with_url(string $conn_url, string $userid = null, string
* @throws CubridException
*
*/
function cubrid_connect(string $host, int $port, string $dbname, string $userid = null, string $passwd = null, bool $new_link = false)
function cubrid_connect(string $host, int $port, string $dbname, ?string $userid = null, ?string $passwd = null, bool $new_link = false)
{
error_clear_last();
if ($new_link !== false) {
Expand Down Expand Up @@ -822,7 +822,7 @@ function cubrid_lob_size($lob_identifier): string
* @throws CubridException
*
*/
function cubrid_lob2_bind($req_identifier, int $bind_index, $bind_value, string $bind_value_type = null): void
function cubrid_lob2_bind($req_identifier, int $bind_index, $bind_value, ?string $bind_value_type = null): void
{
error_clear_last();
if ($bind_value_type !== null) {
Expand Down Expand Up @@ -1300,7 +1300,7 @@ function cubrid_next_result($result): void
* @throws CubridException
*
*/
function cubrid_pconnect_with_url(string $conn_url, string $userid = null, string $passwd = null)
function cubrid_pconnect_with_url(string $conn_url, ?string $userid = null, ?string $passwd = null)
{
error_clear_last();
if ($passwd !== null) {
Expand Down Expand Up @@ -1345,7 +1345,7 @@ function cubrid_pconnect_with_url(string $conn_url, string $userid = null, strin
* @throws CubridException
*
*/
function cubrid_pconnect(string $host, int $port, string $dbname, string $userid = null, string $passwd = null)
function cubrid_pconnect(string $host, int $port, string $dbname, ?string $userid = null, ?string $passwd = null)
{
error_clear_last();
if ($passwd !== null) {
Expand Down Expand Up @@ -1409,7 +1409,7 @@ function cubrid_prepare($conn_identifier, string $prepare_stmt, int $option = 0)
* @throws CubridException
*
*/
function cubrid_put($conn_identifier, string $oid, string $attr = null, $value = null): void
function cubrid_put($conn_identifier, string $oid, ?string $attr = null, $value = null): void
{
error_clear_last();
if ($value !== null) {
Expand Down Expand Up @@ -1837,7 +1837,7 @@ function cubrid_rollback($conn_identifier): void
* @throws CubridException
*
*/
function cubrid_schema($conn_identifier, int $schema_type, string $class_name = null, string $attr_name = null): array
function cubrid_schema($conn_identifier, int $schema_type, ?string $class_name = null, ?string $attr_name = null): array
{
error_clear_last();
if ($attr_name !== null) {
Expand Down
4 changes: 2 additions & 2 deletions generated/curl.php
Expand Up @@ -532,7 +532,7 @@ function curl_exec(\CurlHandle $handle)
* @throws CurlException
*
*/
function curl_getinfo(\CurlHandle $handle, int $option = null)
function curl_getinfo(\CurlHandle $handle, ?int $option = null)
{
error_clear_last();
if ($option !== null) {
Expand Down Expand Up @@ -562,7 +562,7 @@ function curl_getinfo(\CurlHandle $handle, int $option = null)
* @throws CurlException
*
*/
function curl_init(string $url = null): \CurlHandle
function curl_init(?string $url = null): \CurlHandle
{
error_clear_last();
if ($url !== null) {
Expand Down
16 changes: 8 additions & 8 deletions generated/datetime.php
Expand Up @@ -319,7 +319,7 @@ function date_sun_info(int $timestamp, float $latitude, float $longitude): array
* @throws DatetimeException
*
*/
function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, float $latitude = null, float $longitude = null, float $zenith = null, float $utcOffset = null)
function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?float $latitude = null, ?float $longitude = null, ?float $zenith = null, ?float $utcOffset = null)
{
error_clear_last();
if ($utcOffset !== null) {
Expand Down Expand Up @@ -422,7 +422,7 @@ function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, f
* @throws DatetimeException
*
*/
function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, float $latitude = null, float $longitude = null, float $zenith = null, float $utcOffset = null)
function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?float $latitude = null, ?float $longitude = null, ?float $zenith = null, ?float $utcOffset = null)
{
error_clear_last();
if ($utcOffset !== null) {
Expand Down Expand Up @@ -460,7 +460,7 @@ function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, fl
* @throws DatetimeException
*
*/
function date(string $format, int $timestamp = null): string
function date(string $format, ?int $timestamp = null): string
{
error_clear_last();
if ($timestamp !== null) {
Expand Down Expand Up @@ -507,7 +507,7 @@ function date(string $format, int $timestamp = null): string
* @throws DatetimeException
*
*/
function gmmktime(int $hour, int $minute = null, int $second = null, int $month = null, int $day = null, int $year = null): int
function gmmktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null): int
{
error_clear_last();
if ($year !== null) {
Expand Down Expand Up @@ -551,7 +551,7 @@ function gmmktime(int $hour, int $minute = null, int $second = null, int $month
* @throws DatetimeException
*
*/
function gmstrftime(string $format, int $timestamp = null): string
function gmstrftime(string $format, ?int $timestamp = null): string
{
error_clear_last();
if ($timestamp !== null) {
Expand Down Expand Up @@ -682,7 +682,7 @@ function gmstrftime(string $format, int $timestamp = null): string
* @throws DatetimeException
*
*/
function idate(string $format, int $timestamp = null): int
function idate(string $format, ?int $timestamp = null): int
{
error_clear_last();
if ($timestamp !== null) {
Expand Down Expand Up @@ -1000,7 +1000,7 @@ function idate(string $format, int $timestamp = null): int
* @throws DatetimeException
*
*/
function strftime(string $format, int $timestamp = null): string
function strftime(string $format, ?int $timestamp = null): string
{
error_clear_last();
if ($timestamp !== null) {
Expand Down Expand Up @@ -1112,7 +1112,7 @@ function strptime(string $timestamp, string $format): array
* @throws DatetimeException
*
*/
function strtotime(string $datetime, int $baseTimestamp = null): int
function strtotime(string $datetime, ?int $baseTimestamp = null): int
{
error_clear_last();
if ($baseTimestamp !== null) {
Expand Down