- Issue created by @webflo
- Status changed to Needs review
12 months ago 12:17pm 20 December 2023 - 🇩🇪Germany webflo
Self-review with a few explanations.
-
+++ b/modules/wingsuit_ui_patterns/src/Plugin/Deriver/LibraryDeriver.php @@ -120,7 +126,7 @@ class LibraryDeriver extends AbstractYamlPatternsDeriver { - $this->config = $config_factory->getEditable('wingsuit_companion.config'); + $this->configFactory = $config_factory;
$this->config Property was dynamically created. This is deprecated in PHP 8.2. The config factory should be injected instead.
See https://mglaman.dev/blog/dependency-injection-anti-patterns-drupal for more information.
-
+++ b/modules/wingsuit_ui_patterns/src/TwigExtension/WingsuitExtension.php @@ -5,14 +5,13 @@ namespace Drupal\wingsuit_ui_patterns\TwigExtension; +class WingsuitExtension extends AbstractExtension {
The TwigExtension class should not be extended, since its the default extension on Drupal core.
-
- 🇬🇧United Kingdom Finn Lewis
Thanks for the patch @webflo.
I was also getting the following warnings:
Deprecated function: Creation of dynamic property Drupal\wingsuit_companion\StreamWrapper\WingsuitStreamWrapper::$config is deprecated in Drupal\wingsuit_companion\StreamWrapper\WingsuitStreamWrapper->__construct() (line 46 of modules/contrib/wingsuit_companion/src/StreamWrapper/WingsuitStreamWrapper.php). Deprecated function: Creation of dynamic property Drupal\wingsuit_companion\StreamWrapper\WingsuitStreamWrapper::$request is deprecated in Drupal\wingsuit_companion\StreamWrapper\WingsuitStreamWrapper->getRequest() (line 110 of modules/contrib/wingsuit_companion/src/StreamWrapper/WingsuitStreamWrapper.php).
I've extended to patch to suppress these, but could do with your review to check I've done it the right way.
- 🇩🇪Germany Patrick R.
The $basePluginId property should be removed form modules/wingsuit_ui_patterns/src/Plugin/Deriver/LibraryDeriver.php - it's already declared in Drupal\ui_patterns\Plugin\Deriver\AbstractPatternsDeriver which is extended by this class but the base definition was apparently updated in ui_patterns 8.x-1.8 release so this will now cause a fatal error.
/** * The base plugin ID. * * @var string */ protected $basePluginId;
- 🇬🇧United Kingdom 8bitplateau
Slightly different version with some more fixes for PHPStorm and installation.
I was getting the following error:
Fatal error: Type of Drupal\wingsuit_ui_patterns\Plugin\Deriver\LibraryDeriver::$basePluginId must be string (as in class Drupal\ui_patterns\Plugin\Deriver\AbstractPatternsDeriver) in /var/www/html/web/modules/contrib/wingsuit_companion/modules/wingsuit_ui_patterns/src/Plugin/Deriver/LibraryDeriver.php on line 22
so added some types
-
Christian.wiedemann →
committed 6e4a5cbb on 8.x-2.x
Issue #3409980: PHP 8.2 compatibility, fix deprecations
-
Christian.wiedemann →
committed 6e4a5cbb on 8.x-2.x
- Status changed to Fixed
9 months ago 3:33pm 16 March 2024 Automatically closed - issue fixed for 2 weeks with no activity.
- 🇬🇧United Kingdom Finn Lewis
Thanks for this @Christian.wiedemann
Any chance of a new tagged release to support PHP 8.2?
- 🇬🇧United Kingdom welly
Feel free to ignore this but added a backport of the patch for the 8.x-2.1release.