laminas / laminas-db

Database abstraction layer, SQL abstraction, result set abstraction, and RowDataGateway and TableDataGateway implementations
https://docs.laminas.dev/laminas-db/
BSD 3-Clause "New" or "Revised" License
119 stars 66 forks source link

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

Closed Grundik closed 1 year ago

Grundik commented 1 year ago

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.

Ocramius commented 1 year ago

Handled in #269