laminas/laminas-db

PHP 8.2 Deprecated: Creation of dynamic property in Laminas\Db\Adapter\Driver\Pdo\Pdo->setProfiler()

Grundik opened this issue · 1 comments

Bug Report

Q A
Version(s) 2.16.1

Summary

setProfiler() method of Laminas\Db\Adapter\Driver\Pdo\Pdo dynamically creates $profiler property, but this behaviour is deprecated in PHP 8.2:

PHP Deprecated:  Creation of dynamic property Laminas\Db\Adapter\Driver\Pdo\Pdo::$profiler is deprecated in .../laminas/laminas-db/src/Adapter/Driver/Pdo/Pdo.php on line 73

Current behavior

Deprecation warning

How to reproduce

Using PHP 8.2:

ini_set('error_reporting', E_ALL);
$driver = new Laminas\Db\Adapter\Driver\Pdo\Pdo([]);
$driver->setProfiler(new Laminas\Db\Adapter\Profiler\Profiler());

Expected behavior

No deprecation warning.

Handled in #269