berlindb / core

All of the required core code
MIT License
256 stars 29 forks source link

Creation of dynamic property is deprecated #161

Open hgodinho opened 1 year ago

hgodinho commented 1 year ago

Hello!

Im having some troubles with BerlinDB in php 8.2, it throws an error saying Creation of dynamic property LCDR\DB\Row\Concept::$modified is deprecated this happens to all the properties from Row:

  Creation of dynamic property LCDR\DB\Row\Concept::$modified is deprecated

  at C:\Users\55119\Elucidário.art\elucidario\packages\core\vendor\berlindb\core\src\Database\Base.php:272
    268▕                }
    269▕
    270▕                // Set all properties
    271▕                foreach ( $args as $key => $value ) {
  ➜ 272▕                        $this->{$key} = $value;
    273▕                }
    274▕        }
    275▕
    276▕        /**

  1   C:\Users\55119\Elucidário.art\elucidario\packages\core\vendor\bin\pest:119
      include("C:\Users\55119\Elucidário.art\elucidario\packages\core\vendor\pestphp\pest\bin\pest")
$ php -v
PHP 8.2.4 (cli) (built: Mar 14 2023 17:54:25) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.2.4, Copyright (c) Zend Technologies

link: https://www.php.net/manual/en/migration82.deprecated.php#:~:text=The%20creation%20of%20dynamic%20properties,not%20affected%20by%20this%20change.

hgodinho commented 1 year ago

adding #[\AllowDynamicProperties] to Base classe solved the issue.

hgodinho commented 1 year ago

actually if we add berlindb with ^2.0.1 version the problem occur, but if we switch the version to @dev it works correctly.