Skip to content

PHP 8 Compatibility: Implicit nullable parameter deprecation in insertMulti() #1059

Description

@salarizadi

I'm getting the following deprecation warning when running the library on PHP 8:

Deprecated: MysqliDb::insertMulti(): Implicitly marking parameter $dataKeys as nullable is deprecated, the explicit nullable type must be used instead in ... on line 850

Affected code (line 850):

public function insertMulti($tableName, array $multiInsertData, array $dataKeys = null)

Important note:
I installed this library via Composer, and the issue exists in the Composer-installed version. However, it appears that this problem has already been fixed in the GitHub repository (the source code on GitHub seems to already use the explicit nullable syntax). This means the fix has not yet been released to Packagist / the Composer package, so users installing via Composer are still affected.

Suggested fix (already applied on GitHub, needs a new release):

public function insertMulti($tableName, array $multiInsertData, ?array $dataKeys = null)

Request:
Could you please tag a new release and publish it to Packagist so that Composer users also receive this fix? Currently, the only workaround for Composer users is to manually patch the file in vendor/, which gets overwritten on every composer update.

Thank you!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions