daun / processwire-dashboard

Configurable dashboard for ProcessWire's admin interface
https://daun.github.io/processwire-dashboard/
GNU General Public License v3.0
54 stars 5 forks source link

PHP 8.2 deprecations #43

Closed adrianbj closed 1 year ago

adrianbj commented 1 year ago

Describe the bug PHP Deprecated: Creation of dynamic property

To Reproduce Load the dashboard on a site running PHP 8.2

Expected behavior No deprecation error

Screenshots

PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelTemplate::$viewFolder is deprecated in /site/modules/Dashboard/DashboardPanel.class.php:89
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelTemplate::$name is deprecated in /site/modules/Dashboard/DashboardPanel.class.php:211
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelTemplate::$class is deprecated in /site/modules/Dashboard/DashboardPanel.class.php:212
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelTemplate::$size is deprecated in /site/modules/Dashboard/DashboardPanel.class.php:214
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelTemplate::$style is deprecated in /site/modules/Dashboard/DashboardPanel.class.php:215
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelTemplate::$align is deprecated in /site/modules/Dashboard/DashboardPanel.class.php:216
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelTemplate::$templateFile is deprecated in .../site/modules/Dashboard/DashboardPanelTemplate.module:69
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelTemplate::$templatePath is deprecated in .../site/modules/Dashboard/DashboardPanelTemplate.module:70
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelTemplate::$variables is deprecated in .../site/modules/Dashboard/DashboardPanelTemplate.module:71
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelNumber::$viewFolder is deprecated in /site/modules/Dashboard/DashboardPanel.class.php:89
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelNumber::$name is deprecated in /site/modules/Dashboard/DashboardPanel.class.php:211
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelNumber::$class is deprecated in /site/modules/Dashboard/DashboardPanel.class.php:212
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelNumber::$size is deprecated in /site/modules/Dashboard/DashboardPanel.class.php:214
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelNumber::$style is deprecated in /site/modules/Dashboard/DashboardPanel.class.php:215
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelNumber::$align is deprecated in /site/modules/Dashboard/DashboardPanel.class.php:216
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelNumber::$locale is deprecated in .../site/modules/Dashboard/DashboardPanelNumber.module:41
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelNumber::$detail is deprecated in .../site/modules/Dashboard/DashboardPanelNumber.module:42
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelNumber::$number is deprecated in .../site/modules/Dashboard/DashboardPanelNumber.module:43
PHP Deprecated: Creation of dynamic property Daun\Dashboard\DashboardPanelNumber::$trend is deprecated in .../site/modules/Dashboard/DashboardPanelNumber.module:44

Context For server-side issues, include the relevant information:

Additional context Simplest solution is probably: #[AllowDynamicProperties] https://stackoverflow.com/questions/74991682/php-8-2-dynamic-properties-deprecated-how-to-use-them-anyway-in-a-compatible-wa

daun commented 1 year ago

Right. I've been afraid this would happen sooner or later.

I currently don't have the time to implement this as I'm not using PHP 8.2 in production at this point. Feel free to submit a PR if you need this urgently.

adrianbj commented 1 year ago

This seems to work a treat: https://github.com/daun/processwire-dashboard/pull/44/files

daun commented 1 year ago

Merged, thanks!