Skip to content

Commit

Permalink
Bring deprecated override files up to php8.4 syntax
Browse files Browse the repository at this point in the history
(Breaking shish/safe changes down into smaller changes for easier review)

I also note that many of these are deprecated since php8.0 - at what point do we want to delete them?

Co-authored-by: Ayesh <[email protected]>
  • Loading branch information
2 people authored and staabm committed Nov 28, 2024
1 parent f87af02 commit 8a6679c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions deprecated/datetime.php
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 8a6679c

Please sign in to comment.