trongate / trongate-framework

The Trongate PHP framework
https://trongate.io
Other
1.12k stars 100 forks source link

fixed a Dynamic Property message on load() method #175

Closed DaFa66 closed 5 months ago

DaFa66 commented 5 months ago

Fix deprecation warning in Modules.php by using an array to store module instances

Resolves issue with dynamic property creation being deprecated in PHP 8.2 and later. Updated load method to use an array to store module instances, avoiding dynamic property creation. This change ensures compatibility with PHP 8.2 and later versions.

Deprecated
: Creation of dynamic property Modules::$trongate_pages is deprecated in
D:\xampp\htdocs\testapp\engine\Modules.php
on line
67

Tested on PHP 8.2.14, 8.2.19 and 8.3.7 (latest build of PHP) and is working fine with DC's new homepage update now using Trongate Pages 👍

trongate commented 5 months ago

That's an outstanding fix. You could have left me with it for three weeks and I would not have figured that one out. Great job. Thanks!