- Issue created by @k_a_l
- Merge request !5Fix dynamic property warning in controllers, phpcs cleanup β (Open) created by k_a_l
There are deprecated warnings about creating a dynamic property in the WidgetEntityAddController
controller:
Deprecated function: Creation of dynamic property Drupal\stacks\Controller\WidgetEntityAddController::$storage is deprecated in Drupal\stacks\Controller\WidgetEntityAddController->__construct() (line 20 of modules/contrib/stacks/src/Controller/WidgetEntityAddController.php).
Deprecated function: Creation of dynamic property Drupal\stacks\Controller\WidgetEntityAddController::$typeStorage is deprecated in Drupal\stacks\Controller\WidgetEntityAddController->__construct() (line 21 of modules/contrib/stacks/src/Controller/WidgetEntityAddController.php).
I think this is caused by PHP 8.2+.
Declare the property in the class definition before the constructor, then assign the value in the constructor as before.
Active
3.0
Code